mirror of
https://github.com/certd/certd.git
synced 2026-04-28 07:57:25 +08:00
chore:menu.meta.show参数支持
This commit is contained in:
@@ -26,6 +26,11 @@ function buildItemMenus(menus: any) {
|
|||||||
}
|
}
|
||||||
const list: any = [];
|
const list: any = [];
|
||||||
for (const sub of menus) {
|
for (const sub of menus) {
|
||||||
|
if (sub.meta?.show != null) {
|
||||||
|
if (sub.meta.show === false || (typeof sub.meta.show === "function" && !sub.meta.show())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
const item: any = {
|
const item: any = {
|
||||||
key: sub.path,
|
key: sub.path,
|
||||||
label: sub.title,
|
label: sub.title,
|
||||||
@@ -34,6 +39,7 @@ function buildItemMenus(menus: any) {
|
|||||||
return <fsIcon icon={sub.icon ?? sub.meta?.icon} />;
|
return <fsIcon icon={sub.icon ?? sub.meta?.icon} />;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
list.push(item);
|
list.push(item);
|
||||||
if (sub.children && sub.children.length > 0) {
|
if (sub.children && sub.children.length > 0) {
|
||||||
item.children = buildItemMenus(sub.children);
|
item.children = buildItemMenus(sub.children);
|
||||||
|
|||||||
Reference in New Issue
Block a user