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

Method constructor

src/tree/model/tree-store.js:5–31  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

3
4export default class TreeStore {
5 constructor(options) {
6 this.currentNode = null;
7 this.currentNodeKey = null;
8
9 for (let option in options) {
10 if (options.hasOwnProperty(option)) {
11 this[option] = options[option];
12 }
13 }
14
15 this.nodesMap = {};
16
17 this.root = new Node({
18 data: this.data,
19 store: this
20 });
21
22 if (this.lazy && this.load) {
23 const loadFn = this.load;
24 loadFn(this.root, (data) => {
25 this.root.doCreateChildren(data);
26 this._initDefaultCheckedNodes();
27 });
28 } else {
29 this._initDefaultCheckedNodes();
30 }
31 }
32
33 filter(value) {
34 const filterNodeMethod = this.filterNodeMethod;

Callers

nothing calls this directly

Calls 2

doCreateChildrenMethod · 0.80

Tested by

no test coverage detected