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

Path of targetNode is old #62

Closed betterRunner closed 4 years ago

betterRunner commented 5 years ago

Hi there, the path of targetNode in the callback nodeDropped is the old path instead of the one after the drop, that makes the updateNode function unable to use. How to fix this? Thanks.

sarimabbas commented 4 years ago

I seem to be running into this problem as well. Was this fixed? Thank you!

vitalik-lapushkin commented 4 years ago

I use traverse() method something like this:

dropHandler([node]) {
  this.$refs.slVueTree.traverse((traverseNode) => {
    let proceed = true;
    if (node.data.id === traverseNode.data.id) {
      console.log(traverseNode);
      proceed = false;
   }
    return proceed;
  });
}

traverseNode will have refreshed state. Before that i add unique id in nodes data field.