mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2025-12-18 00:45:54 +08:00
improve code
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
import { otherRouter } from '@/router/router';
|
import { otherRouter } from '@/router/router';
|
||||||
import { router } from '@/router/index';
|
import { router } from '@/router/index';
|
||||||
import Util from '@/libs/util';
|
import Util from '@/libs/util';
|
||||||
import Cookies from 'js-cookie';
|
|
||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
|
|
||||||
const app = {
|
const app = {
|
||||||
@@ -47,11 +46,11 @@ const app = {
|
|||||||
// 动态添加主界面路由,需要缓存
|
// 动态添加主界面路由,需要缓存
|
||||||
updateAppRouter(state, routes) {
|
updateAppRouter(state, routes) {
|
||||||
state.routers.push(...routes);
|
state.routers.push(...routes);
|
||||||
router.addRoutes(routes);
|
routes.forEach(route => router.addRoute(route));
|
||||||
},
|
},
|
||||||
// 动态添加全局路由404、500等页面,不需要缓存
|
// 动态添加全局路由404、500等页面,不需要缓存
|
||||||
updateDefaultRouter(state, routes) {
|
updateDefaultRouter(state, routes) {
|
||||||
router.addRoutes(routes);
|
routes.forEach(route => router.addRoute(route));
|
||||||
},
|
},
|
||||||
setLoading(state, v) {
|
setLoading(state, v) {
|
||||||
state.loading = v;
|
state.loading = v;
|
||||||
|
|||||||
Reference in New Issue
Block a user