MCPcopy Create free account
hub / github.com/ElemeFE/element-react / loadData

Method loadData

src/tree/model/node.js:338–361  ·  view source on GitHub ↗
(callback, defaultProps = {})

Source from the content-addressed store, hash-verified

336 }
337
338 loadData(callback, defaultProps = {}) {
339 if (this.store.lazy === true && this.store.load && !this.loaded && !this.loading) {
340 this.loading = true;
341
342 const resolve = (children) => {
343 this.loaded = true;
344 this.loading = false;
345 this.childNodes = [];
346
347 this.doCreateChildren(children, defaultProps);
348
349 this.updateLeafState();
350 if (callback) {
351 callback.call(this, children);
352 }
353 };
354
355 this.store.load(this, resolve);
356 } else {
357 if (callback) {
358 callback.call(this);
359 }
360 }
361 }
362}

Callers 2

expandMethod · 0.95
setCheckedMethod · 0.95

Calls 1

loadMethod · 0.80

Tested by

no test coverage detected