Tree: fix lazy-load check problem (#21934)

pull/22148/head
keray 2022-09-13 15:01:59 +08:00 committed by GitHub
parent 29c5f6b16c
commit bccadfc263
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 4 deletions

View File

@ -23,7 +23,7 @@ export const getChildState = 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);
if (all) {
@ -463,12 +463,11 @@ export default class Node {
this.loading = true;
const resolve = (children) => {
this.loaded = true;
this.loading = false;
this.childNodes = [];
this.doCreateChildren(children, defaultProps);
this.loaded = true;
this.loading = false;
this.updateLeafState();
if (callback) {
callback.call(this, children);