Kaynağa Gözat

菜单优化

quwangxin 2 yıl önce
ebeveyn
işleme
89bb7c7bfb
1 değiştirilmiş dosya ile 10 ekleme ve 8 silme
  1. 10 8
      src/store/modules/user.js

+ 10 - 8
src/store/modules/user.js

@@ -13,16 +13,18 @@ const formatRouter = (list) => {
     let arr = [];
     for (const p of list) {
       if (p.menuType === 2) {
-        p.children = [];
-        authorities.push(p);
+        // p.children = [];
+        // authorities.push(p);
+        p.hide = true;
+      }
+      //  else {
+      if (p.children?.length) {
+        p.children = fn(p.children);
       } else {
-        if (p.children?.length) {
-          p.children = fn(p.children);
-        } else {
-          p.children = [];
-        }
-        arr.push(p);
+        p.children = [];
       }
+      arr.push(p);
+      // }
     }
 
     return arr;