Browse Source

perf: menu

xiaoxian521 3 years ago
parent
commit
fcdfe6d0c0
2 changed files with 5 additions and 0 deletions
  1. 4 0
      src/layout/components/sidebar/sidebarItem.vue
  2. 1 0
      src/layout/types.ts

+ 4 - 0
src/layout/components/sidebar/sidebarItem.vue

@@ -111,6 +111,10 @@ function hasOneShowingChild(
     return true;
   });
 
+  if (showingChildren[0]?.meta?.showParent) {
+    return false;
+  }
+
   if (showingChildren.length === 1) {
     return true;
   }

+ 1 - 0
src/layout/types.ts

@@ -67,6 +67,7 @@ export type childrenType = {
     icon?: string;
     title?: string;
     i18n?: boolean;
+    showParent?: boolean;
     extraIcon?: {
       svg?: boolean;
       name?: string;