From cec5166970f7f229f8e9f85ec91e32e85f667298 Mon Sep 17 00:00:00 2001 From: ray_wuhao <443547225@qq.com> Date: Tue, 4 Jul 2023 14:54:01 +0800 Subject: [PATCH] =?UTF-8?q?bug=20fixed:=20=E4=BF=AE=E5=A4=8D=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E6=A1=86=E8=83=BD=E6=A3=80=E7=B4=A2=E9=9A=90=E8=97=8F?= =?UTF-8?q?=E8=B7=AF=E7=94=B1=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/SiderBar/Components/GlobalSeach/index.tsx | 2 +- src/router/helper/routerCopilot.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/layout/components/SiderBar/Components/GlobalSeach/index.tsx b/src/layout/components/SiderBar/Components/GlobalSeach/index.tsx index 69b33eb4..a0043692 100644 --- a/src/layout/components/SiderBar/Components/GlobalSeach/index.tsx +++ b/src/layout/components/SiderBar/Components/GlobalSeach/index.tsx @@ -97,7 +97,7 @@ const GlobalSeach = defineComponent({ const filterArr = (options: AppMenuOption[]) => { options.forEach((curr) => { - if (curr.children?.length) { + if (curr.children?.length && validMenuItemShow(curr)) { filterArr(curr.children) } diff --git a/src/router/helper/routerCopilot.ts b/src/router/helper/routerCopilot.ts index f19c0ee1..4caec228 100644 --- a/src/router/helper/routerCopilot.ts +++ b/src/router/helper/routerCopilot.ts @@ -72,11 +72,11 @@ export const validMenuItemShow = (option: AppMenuOption) => { return false } - if (!sameLevel && !hidden) { - return true + if (hidden) { + return false } - return !hidden ? true : false + return true } /**