javascript Vue Vuex打字稿模块操作导出
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了javascript Vue Vuex打字稿模块操作导出相关的知识,希望对你有一定的参考价值。
const moduleActions = deployments.actions;
export const actions = {
fetchDeploymentsVersions: dispatch(moduleActions.fetchDeploymentsVersions),
fetchDeploymentsEvents: dispatch(moduleActions.fetchDeploymentsEvents),
fetchDeploymentTabAvailableVersions: dispatch(
moduleActions.fetchDeploymentTabAvailableVersions
),
fetchCurrentDeploymentStatus: dispatch(
moduleActions.fetchCurrentDeploymentStatus
),
fetchCurrentDeploymentStatusThenRepeat: dispatch(
moduleActions.fetchCurrentDeploymentStatusThenRepeat
),
fetchDeploymentHistory: dispatch(moduleActions.fetchDeploymentHistory),
fetchInstanceLog: dispatch(moduleActions.fetchInstanceLog),
fetchAllInstanceLogs: dispatch(moduleActions.fetchAllInstanceLogs),
fetchServiceInstances: dispatch(moduleActions.fetchServiceInstances),
fetchServiceLogTypes: dispatch(moduleActions.fetchServiceLogTypes),
deployService: dispatch(moduleActions.deployService),
revertDeployment: dispatch(moduleActions.revertDeployment),
fetchDeploymentTabDownloadEvents: dispatch(
moduleActions.fetchDeploymentDownloadEvents
),
subscribeToCurrentDeploymentStatus: dispatch(
moduleActions.subscribeToCurrentDeploymentStatus
),
refreshSubscriptionToCurrentDeploymentStatus: dispatch(
moduleActions.refreshSubscriptionToCurrentDeploymentStatus
),
unsubscribeFromCurrentDeploymentStatus: dispatch(
moduleActions.unsubscribeFromCurrentDeploymentStatus
)
};
const moduleGetters = deployments.getters;
export const getters = {
getSelectedEnvironment: read(moduleGetters.selectedEnvironment),
getDeploymentsTab: read(moduleGetters.selectedDeploymentTab),
getDeploymentsVersions: read(moduleGetters.versionsTabVersions),
getDeploymentsEvents: read(moduleGetters.events),
deploymentTabAvailableVersions: read(
moduleGetters.deploymentTabAvailableVersions
),
deploymentHistory: read(moduleGetters.deploymentHistory),
lastSettledDeploymentStatus: read(moduleGetters.lastSettledDeploymentStatus),
currentDeploymentStatusWatch: read(
moduleGetters.currentDeploymentStatusWatch
),
currentInProgressDeploymentStatus: read(
moduleGetters.currentInProgressDeploymentStatus
),
getDeploymentDownloadEvents: read(moduleGetters.deploymentDownloadEvents),
getServiceInstances: read(moduleGetters.serviceInstances),
getServiceLogTypes: read(moduleGetters.serviceLogTypes)
};
const moduleMutations = deployments.mutations;
export const mutations = {
commitSetSelectedEnvironment: commit(
moduleMutations.SET_SELECTED_ENVIRONMENT
),
commitDeploymentsVersions: commit(moduleMutations.SET_VERSIONS_TAB_VERSIONS),
commitDeploymentsEvents: commit(moduleMutations.SET_DEPLOYMENTS_EVENTS),
commitSetSelectedDeploymentTab: commit(
moduleMutations.SET_SELECTED_DEPLOYMENT_TAB
),
commitDeploymentTabVersions: commit(
moduleMutations.SET_DEPLOYMENT_TAB_AVAILABLE_VERSIONS
),
commitCurrentDeploymentStatus: commit(
moduleMutations.SET_CURRENT_DEPLOYMENT_STATUS
),
commitDeploymentTabDeploymentHistory: commit(
moduleMutations.SET_DEPLOYMENT_TAB_DEPLOYMENT_HISTORY
),
commitDeploymentTabDeploymentDownloadEvents: commit(
moduleMutations.SET_DEPLOYMENT_TAB_DOWNLOAD_DEPLOYMENT_EVENTS
),
commitCurrentDeploymentStatusWatchTimeoutId: commit(
moduleMutations.SET_CURRENT_DEPLOYMENT_STATUS_WATCH_TIMEOUT_ID
),
commitStartCurrentDeploymentStatusWatch: commit(
moduleMutations.SET_START_CURRENT_DEPLOYMENT_STATUS_WATCH
),
commitEndCurrentDeploymentStatusWatch: commit(
moduleMutations.SET_END_CURRENT_DEPLOYMENT_STATUS_WATCH
),
commitServiceInstances: commit(moduleMutations.SET_LOGS_TAB_INSTANCES),
commitServiceLogTypes: commit(moduleMutations.SET_LOGS_TAB_LOG_TYPES),
commitAllInstanceLogsUrl: commit(moduleMutations.SET_LOGS_TAB_ALL_LOGS_URL)
};
以上是关于javascript Vue Vuex打字稿模块操作导出的主要内容,如果未能解决你的问题,请参考以下文章
使用带有打字稿的 Vuex 4,类型“ComponentPublicInstance”上不存在属性“$store”
如何使用 Quasar 框架访问 Vuex 存储模块操作中的 Vue 路由器?
如何在带有打字稿的 vue.js 中使用 javascript 组件?