소스 검색

类型强制转换

zhengnaiwen_citu 1 년 전
부모
커밋
93ad6c19c3
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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;
 }