Tree: fix updateKeyChildren

This commit is contained in:
Leopoldthecoder
2017-11-03 14:01:33 +08:00
committed by 杨奕
parent 03ccdb4fbc
commit fa522dd2bc

View File

@@ -198,10 +198,9 @@ export default class TreeStore {
const node = this.nodesMap[key];
if (!node) return;
const childNodes = node.childNodes;
for (let i = 0, j = childNodes.length; i < j; i++) {
const child = childNodes[i];
childNodes.forEach(child => {
this.remove(child.data);
}
});
for (let i = 0, j = data.length; i < j; i++) {
const child = data[i];
this.append(child, node.data);