From 3a59abd3a9a99d98345e602e428a6a9c7d7c42cd Mon Sep 17 00:00:00 2001 From: caiyaonan Date: Wed, 29 Nov 2023 18:09:45 +0800 Subject: [PATCH] Fixed an issue where the hidden judgment of menus above the second level is invalid, resulting in blank spaces and arrow icons appearing in the menu. --- src/layout/components/Sidebar/SidebarItem.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/layout/components/Sidebar/SidebarItem.vue b/src/layout/components/Sidebar/SidebarItem.vue index a418c3d7..902da0d9 100644 --- a/src/layout/components/Sidebar/SidebarItem.vue +++ b/src/layout/components/Sidebar/SidebarItem.vue @@ -62,8 +62,12 @@ export default { if (item.hidden) { return false } else { + // Recursive children, determine whether multi-layer submenus need to be hidden. + if (item.hidden) { + return this.hasOneShowingChild(item.children, item) + } // Temp set(will be used if only has one showing child) - this.onlyOneChild = item + this.onlyOneChild = item return true } })