Closed FlameArtLab closed 5 years ago
If we push any item with childs to Data, like this in Base Example:
this.originalData.push({text: "HELLO", children: [{text: "HELLO 2"}]})
we get an error "TypeError: Cannot read property 'level' of undefined"
Fix for that in TreeNode.vue->watch handler, need to add recursive init for new arrays:
insert
th.breadthFirstSearch(data, (node, k, parent) => { if(parent===undefined) parent=this.$parent.data; data._vm.store.compeleteNode(node, parent) });
instead of just
this.store.compeleteNode(data, this.$parent.data)
edited: fixed top level parent definition
Now, it works good
fixed in 2.1.8
Thanks!
If we push any item with childs to Data, like this in Base Example:
we get an error "TypeError: Cannot read property 'level' of undefined"
Fix for that in TreeNode.vue->watch handler, need to add recursive init for new arrays:
insert
instead of just
edited: fixed top level parent definition
Now, it works good