mirror of https://github.com/ElemeFE/element
Tree: fix lazy-load check problem (#21934)
parent
29c5f6b16c
commit
bccadfc263
|
@ -23,7 +23,7 @@ export const getChildState = node => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const reInitChecked = function(node) {
|
const reInitChecked = function(node) {
|
||||||
if (node.childNodes.length === 0) return;
|
if (node.childNodes.length === 0 || node.loading) return;
|
||||||
|
|
||||||
const {all, none, half} = getChildState(node.childNodes);
|
const {all, none, half} = getChildState(node.childNodes);
|
||||||
if (all) {
|
if (all) {
|
||||||
|
@ -463,12 +463,11 @@ export default class Node {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
|
||||||
const resolve = (children) => {
|
const resolve = (children) => {
|
||||||
this.loaded = true;
|
|
||||||
this.loading = false;
|
|
||||||
this.childNodes = [];
|
this.childNodes = [];
|
||||||
|
|
||||||
this.doCreateChildren(children, defaultProps);
|
this.doCreateChildren(children, defaultProps);
|
||||||
|
this.loaded = true;
|
||||||
|
this.loading = false;
|
||||||
this.updateLeafState();
|
this.updateLeafState();
|
||||||
if (callback) {
|
if (callback) {
|
||||||
callback.call(this, children);
|
callback.call(this, children);
|
||||||
|
|
Loading…
Reference in New Issue