initNodes()

in helpers/navigation/nav_tree.js [21:31]


  initNodes(items = [], parent = null, depth = 0) {
    if (!items.length) {
      return;
    }
    items.forEach((item) => {
      const node = new Node({ ...item, parent, depth });
      this.nodes.push(node);
      parent?.addChild(node);
      this.initNodes(item.items, node, depth + 1);
    });
  }