This commit is contained in:
Ah jung
2021-07-17 16:24:49 +08:00
parent 3cb7a7f54f
commit 770d39871a
5 changed files with 41 additions and 60 deletions

View File

@@ -12,7 +12,7 @@ export function renderIcon(icon) {
/**
* 递归组装菜单格式
*/
export function generatorMenu(routerMap: Array<any>, parent?: object) {
export function generatorMenu(routerMap: Array<any>) {
return routerMap.filter(item => {
return item.meta.hidden != true && !['/:path(.*)*', '/', '/redirect', '/login'].includes(item.path)
}).map(item => {
@@ -25,7 +25,7 @@ export function generatorMenu(routerMap: Array<any>, parent?: object) {
// 是否有子菜单,并递归处理
if (item.children && item.children.length > 0) {
// Recursion
currentMenu.children = generatorMenu(item.children, currentMenu)
currentMenu.children = generatorMenu(item.children)
}
return currentMenu
})