子菜单个数限制优化
This commit is contained in:
parent
2281032b54
commit
cfaad235be
@ -38,7 +38,7 @@ const getFilterMenus = (arr, role, parentPath = '') => {
|
||||
icon: item.icon,
|
||||
}
|
||||
if (item.children) {
|
||||
if (item.children.length === 1) {
|
||||
if (item.children.filter(child => !child.hidden).length <= 1) {
|
||||
menu.url = generateUrl(item.children[0].path, menu.url)
|
||||
} else {
|
||||
menu.children = getFilterMenus(item.children, role, menu.url)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user