mirror of
https://github.com/jekip/naive-ui-admin.git
synced 2026-02-04 13:42:27 +08:00
Merge pull request #192 from honorsuper/patch-5
feat: 左侧菜单,过滤children下面的item为hidden状态
This commit is contained in:
@@ -104,7 +104,10 @@ export function getChildrenRouter(routerMap: Array<any>) {
|
||||
* 判断根路由 Router
|
||||
* */
|
||||
export function isRootRouter(item) {
|
||||
return item.meta?.alwaysShow != true && item.children?.length === 1;
|
||||
return (
|
||||
item.meta?.alwaysShow != true &&
|
||||
item?.children?.filter((item) => !Boolean(item?.meta?.hidden))?.length === 1
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user