holiber / sl-vue-tree

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

New paths + getParent() method on drop ? #15

Closed onekiloparsec closed 6 years ago

onekiloparsec commented 6 years ago

Hi,

I am struggling a bit to update a backend with the current state of information we get on the drop callback.

There are 3 arguments: draggingNodes, position, and event. However, the path of each node inside draggingNodes are the old ones, and the position also contains the old path of the targetNode.

Morover, one couldn't get the updated indexes / paths without knowing the parent. And the getParent() method is missing (there is one such method inside the code, but it does something else).

I would be happy to write myself, but so far I couldn't get to know when the tree paths are actually updated. Thanks!

holiber commented 6 years ago

Hello, sorry for the late response. I'm working on v2 of sl-vue-tree to resolve the most of issues like that. The nodes paths are creating inside the computed nodes property.

onekiloparsec commented 6 years ago

Okay, thanks ! I guess I'll wait for v2, then. I'll happy to beta-test if you need so.