提交 f2770764 authored 作者: Yroc's avatar Yroc

添加无路径菜单导致无法进入系统错误修改

上级 2575e99b
......@@ -60,22 +60,25 @@ function routerCom(view_path) {//不支持全路径,支持拼接路径
function transListToTreeData(list, rootValue) {
let arr = []
list.forEach(item => {
let elememt = {
id: item.id,
father_id: item.father_id,
is_show: item.is_show,
path: item.path,
name: item.name,
component: routerCom(item.view_path),
meta: { title: item.name_zh }
};
if (item.father_id === rootValue) {
const children = transListToTreeData(list, item.id)
if (children.length > 0) {
elememt.children = children
if (item.path){
let elememt = {
id: item.id,
father_id: item.father_id,
is_show: item.is_show,
path: item.path,
name: item.name,
component: routerCom(item.view_path),
meta: { title: item.name_zh }
};
if (item.father_id === rootValue) {
const children = transListToTreeData(list, item.id)
if (children.length > 0) {
elememt.children = children
}
arr.push(elememt)
}
arr.push(elememt)
}
})
return arr
}
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论