initNodes()

in src/components/base/form/form_checkbox_tree/models/tree.js [49:60]


  initNodes(options = [], selected = [], parent = null, depth = 0) {
    if (!options.length) {
      return;
    }
    this.treeDepth = depth > this.treeDepth ? depth : this.treeDepth;

    options.forEach((option) => {
      const isChecked = selected.includes(option.value);
      this.nodes[option.value] = new Node({ ...option, parent, isChecked, depth });
      this.initNodes(option.children, selected, option, depth + 1);
    });
  }