Browse Source

类型强制转换

zhengnaiwen_citu 1 năm trước cách đây
mục cha
commit
93ad6c19c3
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  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;
 }