shilipojs преди 2 години
родител
ревизия
b0c0ab1e60
променени са 2 файла, в които са добавени 10 реда и са изтрити 2 реда
  1. 7 1
      src/components/Top/index.vue
  2. 3 1
      src/views/index/login.vue

+ 7 - 1
src/components/Top/index.vue

@@ -143,23 +143,29 @@ export default {
       if (item.children) {
         //有二级菜单
         item.children.forEach((item2) => {
+          console.log(item2)
           if (item2.children) {
             item2.children.forEach((item3) => {
               item3.path = item.path + '/' + item2.path + '/' + item3.path
             })
             if (!routes && item2.children.length) {
+              console.log(22222222222222)
+              console.log(item2.children)
               //一级菜单下面第一个有3个菜单的二级菜单
               routes = item2.children
               routesTo = item2.children
             }
           } else {
-            routes = []
+            if (!routes) {
+              routes = []
+            }
             routesTo = item.children
           }
           item2.path = item.path + '/' + item2.path
           item2.level = 2
           second.push(item2)
         })
+        console.log(routes)
         // let fal = false
         //选中第一个
         auth.setActiveMenu(second[0].path)

+ 3 - 1
src/views/index/login.vue

@@ -289,7 +289,9 @@ export default {
               routesTo = item2.children
             }
           } else {
-            routes = []
+            if (!routes) {
+              routes = []
+            }
             routesTo = item.children
           }
           item2.path = item.path + '/' + item2.path