diff --git a/app/js/config/router.tsx b/app/js/config/router.tsx index 15541014..e6039c4e 100644 --- a/app/js/config/router.tsx +++ b/app/js/config/router.tsx @@ -125,7 +125,7 @@ export const router: readonly Route[] = [ path: 'tabs', meta: { name: '标签导航', - // type: MenuType.TABS, + type: MenuType.TABS, icon: }, element: lazy(() => import('/js/components/RouteTabs')), @@ -143,7 +143,7 @@ export const router: readonly Route[] = [ path: 'first', meta: { name: '标签页一一', - // type: MenuType.HIDDEN, + type: MenuType.HIDDEN, icon: }, element: lazy(() => import('/js/pages/System/Tabs/First')) diff --git a/app/js/utils/menus.ts b/app/js/utils/menus.ts index c912f716..55611426 100644 --- a/app/js/utils/menus.ts +++ b/app/js/utils/menus.ts @@ -93,6 +93,10 @@ export function nparse( } else { const parentKey = parent ? parent.meta.key : null; + if (parentKey) { + removeable.delete(parentKey); + } + if (icon == null) { mapping.set(key, [parentKey, transform({ key, name, link }, node)]); } else { @@ -103,14 +107,8 @@ export function nparse( console.group('菜单转换过滤'); - for (const [, [parentKey]] of mapping) { - if (parentKey) { - removeable.delete(parentKey); - } - } - - console.log('已删除的菜单', removeable); - console.log('过滤菜单长度', mapping.size); + console.log('可删除菜单', removeable); + console.log('映射菜单数', mapping.size); for (const [key, [parentKey, menu]] of mapping) { if (!removeable.has(key)) {