holiber / sl-vue-tree

Customizable draggable tree component for Vue.js
https://holiber.github.io/sl-vue-tree/
MIT License
345 stars 78 forks source link

i wan edit a title after click #48

Closed nazaninhesari closed 5 years ago

nazaninhesari commented 5 years ago

i wan edit a title after click a node , example node 1 >>> node 2 rename

nazaninhesari commented 5 years ago

i solved this

this.$refs.slVueTree.insert({node:thisnode,placement: "inside"}, {title: "Dragged Item"});

nazaninhesari commented 5 years ago

how i can update a node

this.$refs.slVueTree.updateNode({node:thisnode}, {title: "changed Item"});

??

nazaninhesari commented 5 years ago

i sloved this by this.$refs.slVueTree.updateNode(node.path, { ...node, title: 88888888}); then i need change id in data this.$refs.slVueTree.updateNode(node.path,{ ...node.data, id: 999}); it not changed id !

holiber commented 5 years ago

You're not updating the data in your exaple

The correct way is

this.$refs.slVueTree.updateNode(node.path, {  data: {id: 999} });
nazaninhesari commented 5 years ago

thanks work fine