Skip to content

Commit

Permalink
Tree: fix lazy-load check problem (ElemeFE#21934)
Browse files Browse the repository at this point in the history
  • Loading branch information
kiss-keray authored and hzsrc committed Feb 2, 2023
1 parent 2e92666 commit 7e631cf
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/tree/src/model/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 7e631cf

Please sign in to comment.