mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2025-12-17 16:35:53 +08:00
页签切换,一级菜单也要选中,报错信息提示多个问题
This commit is contained in:
@@ -338,6 +338,18 @@ util.initRouter = function (vm) { // 初始化路由
|
||||
if (!menuData) {
|
||||
return;
|
||||
}
|
||||
// 格式化数据,设置 空children 为 null
|
||||
for(let i =0;i<menuData.length;i++){
|
||||
let t = menuData[i].children
|
||||
for(let k = 0;k<t.length;k++){
|
||||
let tt = t[k].children;
|
||||
for(let z = 0;z<tt.length;z++){
|
||||
tt[z].children = null
|
||||
// 给所有三级路由添加字段,显示一级菜单name,方便点击页签时的选中筛选
|
||||
tt[z].firstRouterName = menuData[i].name
|
||||
}
|
||||
}
|
||||
}
|
||||
util.initAllMenuData(constRoutes, menuData);
|
||||
util.initRouterNode(otherRoutes, otherRouter);
|
||||
// 添加所有主界面路由
|
||||
@@ -451,6 +463,7 @@ util.initRouterNode = function (routers, data) { // data为所有子菜单数
|
||||
meta.permTypes = menu.permTypes ? menu.permTypes : null;
|
||||
meta.title = menu.title ? menu.title + " - lilishop商家后台" : null;
|
||||
meta.url = menu.url ? menu.url : null;
|
||||
meta.firstRouterName = item.firstRouterName
|
||||
menu.meta = meta;
|
||||
|
||||
routers.push(menu);
|
||||
|
||||
Reference in New Issue
Block a user