Explorar o código

类型强制转换

zhengnaiwen_citu hai 1 ano
pai
achega
93ad6c19c3
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      sheep/util/index.js

+ 1 - 1
sheep/util/index.js

@@ -96,7 +96,7 @@ export function handleTree(data, id = 'id', parentId = 'parentId', children = 'c
     });
     branchArr.length > 0 ? father.children = branchArr : '';
     //返回第一层
-    return father[parentId] === rootId;
+    return +father[parentId] === +rootId;
   });
   return treeData !== '' ? treeData : data;
 }