import { Module, MutationTree } from 'vuex' import Vue from 'vue' import { RootState } from '@/store' interface LoadingState { status: string } const mutations: MutationTree = { start(state: LoadingState) { state.status = 'start' if (window.__POWERED_BY_QIANKUN__) { Vue.prototype.$parentLodingStore.start() } }, completed(state: LoadingState) { state.status = 'completed' if (window.__POWERED_BY_QIANKUN__) { Vue.prototype.$parentLodingStore.completed() } }, } const loadingState: LoadingState = { status: '', } const loading: Module = { namespaced: true, state: loadingState, mutations, } export default loading