diff --git a/packages/tree/src/model/node.js b/packages/tree/src/model/node.js index c4bf5481..c940a8ab 100644 --- a/packages/tree/src/model/node.js +++ b/packages/tree/src/model/node.js @@ -301,7 +301,6 @@ export default class Node { child.setChecked(isCheck, deep, true, passValue); } const { half, all } = getChildState(childNodes); - console.log(this.data.label, all); if (!all) { this.checked = all; this.indeterminate = half; diff --git a/packages/tree/src/model/tree-store.js b/packages/tree/src/model/tree-store.js index f019bac8..bc686f82 100644 --- a/packages/tree/src/model/tree-store.js +++ b/packages/tree/src/model/tree-store.js @@ -188,11 +188,10 @@ export default class TreeStore { } _setCheckedKeys(key, leafOnly = false, checkedKeys) { - let allNodes = this._getAllNodes().sort((a, b) => a.level - b.level); - + const allNodes = this._getAllNodes().sort((a, b) => b.level - a.level); const keys = Object.keys(checkedKeys); for (let node of allNodes) { - let checked = keys.indexOf(node.data[key].toString()) > -1; + let checked = keys.indexOf(node.data[key] + '') > -1; if (!checked) { node.setChecked(false, false); continue;