diff --git a/src/components/Application/src/search/useMenuSearch.ts b/src/components/Application/src/search/useMenuSearch.ts index c7441d9c3..9101b4ac9 100644 --- a/src/components/Application/src/search/useMenuSearch.ts +++ b/src/components/Application/src/search/useMenuSearch.ts @@ -64,15 +64,15 @@ export function useMenuSearch(refs: Ref, scrollWrap: Ref, function handlerSearchResult(filterMenu: Menu[], reg: RegExp, parent?: Menu) { const ret: SearchResult[] = []; filterMenu.forEach((item) => { - const { name, path, icon, children, hideMenu } = item; - if (!hideMenu && reg.test(name) && !children?.length) { + const { name, path, icon, children, hideMenu, meta } = item; + if (!hideMenu && reg.test(name) && (!children?.length || meta?.hideChildrenInMenu)) { ret.push({ name: parent?.name ? `${parent.name} > ${name}` : name, path, icon, }); } - if (Array.isArray(children) && children.length) { + if (!meta?.hideChildrenInMenu && Array.isArray(children) && children.length) { ret.push(...handlerSearchResult(children, reg, item)); } }); diff --git a/src/router/routes/modules/about.ts b/src/router/routes/modules/about.ts index 03cb42511..31b0c0621 100644 --- a/src/router/routes/modules/about.ts +++ b/src/router/routes/modules/about.ts @@ -22,6 +22,7 @@ const dashboard: AppRouteModule = { meta: { title: t('routes.dashboard.about'), icon: 'simple-icons:about-dot-me', + // hideMenu: true, }, }, ],