Commit b70fade587057f2077648c2cd60103c3fb2250b8

Authored by XC
Committed by GitHub
1 parent 05bad7b9

fix(treeHelper): 修复 listToTree 方法 parent 获取 children 问题 (#1464)

src/utils/helper/treeHelper.ts
... ... @@ -24,7 +24,7 @@ export function listToTree<T = any>(list: any[], config: Partial<TreeHelperConfi
24 24 }
25 25 for (const node of list) {
26 26 const parent = nodeMap.get(node[pid]);
27   - (parent ? parent.children : result).push(node);
  27 + (parent ? parent[children] : result).push(node);
28 28 }
29 29 return result;
30 30 }
... ...