mirror of https://github.com/ElemeFE/element
Tree: fix can not update children in some condition. (#1524)
parent
34756d17ca
commit
5285856100
|
@ -163,17 +163,17 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
const tree = this.tree;
|
const tree = this.tree;
|
||||||
const props = this.props || {};
|
if (!tree) {
|
||||||
|
console.warn('Can not find node\'s tree.');
|
||||||
|
}
|
||||||
|
|
||||||
|
const props = tree.props || {};
|
||||||
const childrenKey = props['children'] || 'children';
|
const childrenKey = props['children'] || 'children';
|
||||||
|
|
||||||
this.$watch(`node.data.${childrenKey}`, () => {
|
this.$watch(`node.data.${childrenKey}`, () => {
|
||||||
this.node.updateChildren();
|
this.node.updateChildren();
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!tree) {
|
|
||||||
console.warn('Can not find node\'s tree.');
|
|
||||||
}
|
|
||||||
|
|
||||||
this.showCheckbox = tree.showCheckbox;
|
this.showCheckbox = tree.showCheckbox;
|
||||||
|
|
||||||
if (this.node.expanded) {
|
if (this.node.expanded) {
|
||||||
|
|
Loading…
Reference in New Issue