mirror of
https://gitee.com/ElemeFE/element.git
synced 2024-12-02 20:28:52 +08:00
Tree: fix setCheckedKeys
This commit is contained in:
parent
476f76875c
commit
02459f1833
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user