holiber / sl-vue-tree

Customizable draggable tree component for Vue.js
MIT License
344 stars 79 forks source link

how add inserted in last children #49

Closed nazaninhesari closed 5 years ago

nazaninhesari commented 5 years ago

how add inserted in last children this.$refs.slVueTree.insert({node:node,placement: "inside"}, { title:node.title,code:node.code}); this code add in first items

holiber commented 5 years ago

you can update the node children:

const nodePath = [1, 2, 3];
slVueTree.updateNode(
  nodePath,
  {children: [ ...slVueTree.getNode(nodePath ).children, { title: 'A New Child2'}]}
)
akolnati commented 5 years ago

just what i have been looking for... Thanks @holiber