Tree: fix updateKeyChildren

pull/7993/merge
Leopoldthecoder 2017-11-03 14:01:33 +08:00 committed by 杨奕
parent 03ccdb4fbc
commit fa522dd2bc
1 changed files with 2 additions and 3 deletions

View File

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