SortableJS / vue.draggable.next

Vue 3 compatible drag-and-drop component based on Sortable.js
https://sortablejs.github.io/vue.draggable.next/#/simple
MIT License
3.91k stars 531 forks source link

get the dragged item from 2 or more draggable v-model with vuex #202

Open zerexei opened 1 year ago

zerexei commented 1 year ago

First check https://github.com/SortableJS/Vue.Draggable/blob/master/CONTRIBUTING.md

Jsfiddle link

Step by step scenario

https://github.com/SortableJS/vue.draggable.next#with-vuex

only move is registered not added/removed when dragging to 2 or more components

image

snippet

<draggable class="draggable" :move="handleItemMove" @end="handleDragEnd" :list="items"
        @change="updateItem($event, group_item_id)" group="items" item-key="id">
  <draggable>

Actual Solution

<draggable v-model="items" @end="getDragItem"> @end doesn't work, how can I get the dragged item when using it with vuex? :list="items" @end="getDragItem" works but not with v-model

Expected Solution

to be able to get the dragged item or the event (evt)