feat: 增加全局loading

This commit is contained in:
fit2cloud-chenyw
2021-03-04 14:58:52 +08:00
parent 2b104fa0f6
commit 02230d5e51
12 changed files with 104 additions and 13 deletions

View File

@@ -2,6 +2,7 @@ import { constantRoutes } from '@/router'
import Layout from '@/layout/index'
const state = {
currentPath: null,
routes: [],
addRoutes: [],
currentRoutes: {}
@@ -14,12 +15,18 @@ const mutations = {
},
SET_CURRENT_ROUTES: (state, routes) => {
state.currentRoutes = routes
},
SET_CURRENT_PATH: (state, path) => {
state.currentPath = path
}
}
const actions = {
GenerateRoutes({ commit }, asyncRouter) {
commit('SET_ROUTERS', asyncRouter)
},
setCurrentPath({ commit }, path) {
commit('SET_CURRENT_PATH', path)
}
}