Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

append item in treeview vuetify

findItem(id, items = null) {
  if (!items) {
    items = this.items;
  }

  return items.reduce((acc, item) => {
    if (acc) {
      return acc;
    }

    if (item.id === id) {
      return item;
    }

    if (item.children) {
      return this.findItem(id, item.children);
    }

    return acc;
  }, null);
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #append #item #treeview #vuetify
ADD COMMENT
Topic
Name
7+1 =