mirror of
https://github.com/Tencent/tdesign-vue-next-starter.git
synced 2024-12-23 02:26:34 +08:00
Merge pull request #70 from Tencent/feat/router/hidden
feat(router): add route hidden
This commit is contained in:
commit
54c8a2824f
|
@ -6,17 +6,19 @@ const getMenuList = (list: MenuRoute[], basePath?: string): MenuRoute[] => {
|
||||||
if (!list) {
|
if (!list) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
return list.map((item) => {
|
return list
|
||||||
const path = basePath ? `${basePath}/${item.path}` : item.path;
|
.map((item) => {
|
||||||
return {
|
const path = basePath ? `${basePath}/${item.path}` : item.path;
|
||||||
path,
|
return {
|
||||||
title: item.meta?.title,
|
path,
|
||||||
icon: item.meta?.icon || '',
|
title: item.meta?.title,
|
||||||
children: getMenuList(item.children, path),
|
icon: item.meta?.icon || '',
|
||||||
meta: item.meta,
|
children: getMenuList(item.children, path),
|
||||||
redirect: item.redirect,
|
meta: item.meta,
|
||||||
};
|
redirect: item.redirect,
|
||||||
});
|
};
|
||||||
|
})
|
||||||
|
.filter((item) => item.meta && item.meta.hidden !== true);
|
||||||
};
|
};
|
||||||
|
|
||||||
const renderIcon = (item) => {
|
const renderIcon = (item) => {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user