tangning 17 hours ago
parent
commit
6aa5ac150c
1 changed files with 7 additions and 2 deletions
  1. 7 2
      src/api/tagging-style.ts

+ 7 - 2
src/api/tagging-style.ts

@@ -122,10 +122,15 @@ export const fetchTaggingStyles = async () => {
       }
     }
   };
-  const tree: any = { children: [] };
+  let tree: any = { children: [] };
+  console.log('tree', tree)
   genTree(treeData, tree);
   styleTypes.length = 0
-  styleTypes.push(...tree.children)
+  console.log('tree', tree)
+  if(!tree.children){
+    tree = { children: [] }
+  }
+  tree.children && styleTypes.push(...tree.children)
   Object.assign(defStyleType, tree.children[tree.children.length - 1])
   
   console.error('StyleT', styleTypes)