소스 검색

Merge branch '03/03Lebao' into test

lex-xin 4 년 전
부모
커밋
9277b7fc32
1개의 변경된 파일13개의 추가작업 그리고 0개의 파일을 삭제
  1. 13 0
      src/layout/components/Sidebar/SidebarItem.vue

+ 13 - 0
src/layout/components/Sidebar/SidebarItem.vue

@@ -128,6 +128,16 @@ export default {
       // When there is only one child router, the child router is displayed by default
 
       if (showingChildren.length === 1) {
+        let filterRouter = ['/commentManagerWrap', 'teamMananger', '/vipManager', '/accompanyManager']
+        let tempOnlyChild = this.onlyOneChild
+        // 如果包含上面几个菜单,并且只有一个
+        if(filterRouter.includes(tempOnlyChild.path) && tempOnlyChild.children.length == 1) {
+          let child = tempOnlyChild.children[0]
+          if(!this.checkPathUrl(child.path)) {
+            child.path = tempOnlyChild.path + '/' + child.path
+          }
+          this.onlyOneChild = child
+        }
         return true;
       }
 
@@ -139,6 +149,9 @@ export default {
 
       return false;
     },
+    checkPathUrl(path) {
+      return path.indexOf('/') === 0 ? true : false
+    },
     resolvePath(routePath) {
       if (isExternal(routePath)) {
         return routePath;