Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

DevSymmetryk's avatar

Vue draggable Change event should have any passed argument wrapped in event type key

Hey guys, I've been trying use this Vue.Draggable package to make a trello clone.

The major problem is that I'm trying to get the data related to the group being dragged from and the data related to the group being added to.

This is the fiddle I've prepared to illustrate my point of vue Draggable demo

When I call the change event with some extra params, the issue is that the I get 2 of every params I'm passing.

update(event, argument) {
    console.log(event); => this print {added: {}} and {removed: {}}
    console.log(argument.id) => this prints (1) and (2)
}

I can access the added item by doing

update(event, argument) {
    console.log(event.added); => this returns an object that I can work with
}

and this is when I try to access any of my params

update(event, argument) {
    console.log(argument); => this returns the argument for added state and the removed state but with no key to access
}

I was thinking that this approach could of helped

update(event, group) {
    console.log(group); // {addedTo: {group}} and {removedFrom: {group}}
}

This is the issue on Vue.Draggable issues page if someone would be intrested in the whole discussion. Change event should have any passed argument wrapped in event type key

0 likes
0 replies

Please or to participate in this conversation.