mushencc hace 3 años
padre
commit
37c877e3b6
Se han modificado 1 ficheros con 12 adiciones y 13 borrados
  1. 12 13
      src/views/BasicSettings/SuppliersManage/SippliersClassify.vue

+ 12 - 13
src/views/BasicSettings/SuppliersManage/SippliersClassify.vue

@@ -164,19 +164,18 @@ export default {
         this.treeData[0].sub = res.data
         // this.openChildrenNode(this.treeData)
       // this.ergodic(this.treeData)
-      function a (row){debugger;
-          row.forEach(item=>{
-       if(item.sub.length==0){
-         item.expand = true
-      
-       }else{
-         item.expand = true
-         this.ergodic(item)
-       }
-     })
-      }
-      a(this.treeData)
-    console.log(this.treeData)
+      this.treeData.forEach(item=>{
+        item.expand=true;
+        if(item.sub.length!=0)
+        item.sub.forEach(_item=>{
+          _item.expand=true;
+          if(_item.sub.length!=0){
+            _item.sub.forEach(__item=>{
+              __item.expand=true
+            })
+          }
+        })
+      })
       }).catch((err) => { });
     },
   ergodic(row){