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

drop from outside source #8

Open agrothe opened 6 years ago

agrothe commented 6 years ago

Question: am I able to apply some classes or data to an element to allow dragging into the tree from an outside source?

I can add elements via selecting a node then then splice/push on the data array, but not having any luck reading the drop event as it's probably set to cancel default and stop propagation?

Maybe expose a drop event with the index of the node dropped onto?

holiber commented 6 years ago

That looks like a good proposal. I'm going to create a PR for that.

holiber commented 6 years ago

I exposed externaldrop event. I need to test it more before release a new version but you can try out demo/externalaldrag.html example from the master branch.