移除重复路由
This commit is contained in:
@ -100,8 +100,7 @@ export default {
|
|||||||
}
|
}
|
||||||
var routes = this.activeRoutes(activePath);
|
var routes = this.activeRoutes(activePath);
|
||||||
if (routes.length === 0) {
|
if (routes.length === 0) {
|
||||||
activePath = this.currentIndex || this.defaultRouter()
|
this.$store.commit("SET_SIDEBAR_ROUTERS", routes);
|
||||||
this.activeRoutes(activePath);
|
|
||||||
}
|
}
|
||||||
return activePath;
|
return activePath;
|
||||||
},
|
},
|
||||||
@ -151,7 +150,7 @@ export default {
|
|||||||
var routes = [];
|
var routes = [];
|
||||||
if (this.childrenMenus && this.childrenMenus.length > 0) {
|
if (this.childrenMenus && this.childrenMenus.length > 0) {
|
||||||
this.childrenMenus.map((item) => {
|
this.childrenMenus.map((item) => {
|
||||||
if (key == item.parentPath || (key == "index" && "" == item.path)) {
|
if (key == item.parentPath) {
|
||||||
routes.push(item);
|
routes.push(item);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -23,12 +23,7 @@ const permission = {
|
|||||||
state.defaultRoutes = constantRoutes.concat(routes)
|
state.defaultRoutes = constantRoutes.concat(routes)
|
||||||
},
|
},
|
||||||
SET_TOPBAR_ROUTES: (state, routes) => {
|
SET_TOPBAR_ROUTES: (state, routes) => {
|
||||||
// 顶部导航菜单默认添加统计报表栏指向首页
|
state.topbarRouters = routes;
|
||||||
const index = [{
|
|
||||||
path: 'index',
|
|
||||||
meta: { title: '统计报表', icon: 'dashboard' }
|
|
||||||
}]
|
|
||||||
state.topbarRouters = routes.concat(index);
|
|
||||||
},
|
},
|
||||||
SET_SIDEBAR_ROUTERS: (state, routes) => {
|
SET_SIDEBAR_ROUTERS: (state, routes) => {
|
||||||
state.sidebarRouters = routes
|
state.sidebarRouters = routes
|
||||||
|
Reference in New Issue
Block a user