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

This commit is contained in:
XC 2021-12-12 22:08:23 +08:00 committed by GitHub
parent 05bad7b9dc
commit b70fade587
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,7 +24,7 @@ export function listToTree<T = any>(list: any[], config: Partial<TreeHelperConfi
}
for (const node of list) {
const parent = nodeMap.get(node[pid]);
(parent ? parent.children : result).push(node);
(parent ? parent[children] : result).push(node);
}
return result;
}