N00ts / vue3-treeview

a simple treeview in vue js 3
MIT License
73 stars 65 forks source link

add support for external data sources #13

Closed Geoffrey-D closed 2 years ago

Geoffrey-D commented 2 years ago

Hello,

This PR triggers the following events when items are dropped from an external source:

Would it be possible to create a new npm version once this PR is merged?

Thx!

N00ts commented 2 years ago

Hey this is cool idea, I think it could be more consistent if there is no "ext" in event name and everything goes in same event. The "external" nature could be handled by sending an object like:

{ external: boolean, dataTransfer, node }

Also in your PR, events seems to be fired twice (drop can emit "drop" and "dropext")

What do you think ?

Geoffrey-D commented 2 years ago

Hey this is cool idea, I think it could be more consistent if there is no "ext" in event name and everything goes in same event. The "external" nature could be handled by sending an object like:

{ external: boolean, dataTransfer, node }

Also in your PR, events seems to be fired twice (drop can emit "drop" and "dropext")

What do you think ?

Excellent idea, I didn't know if I could alter the standard events.

I made the changes, I let you check if it fits your idea :)

N00ts commented 2 years ago

Looks really good ! Can you update documentation ?

Geoffrey-D commented 2 years ago

Done! I also always added the "evt, external & dataTransfer" data to be more consistent

Geoffrey-D commented 2 years ago

Is everything OK with this PR? can it be merged?

N00ts commented 2 years ago

Seems that tests are broken can you repair it ? ^^

Geoffrey-D commented 2 years ago

Sorry about that, fixed