Vue.Draggable
Vue.Draggable copied to clipboard
Can't sort manually from parent component
First check https://github.com/SortableJS/Vue.Draggable/blob/master/CONTRIBUTING.md
Jsfiddle link
Step by step scenario
- define a list
- iterate list items and create draggable element component inside
<draggable>component - the components inside draggable component should be draggable with configs
- we can disable sorting in that case it won't sort after drag end
- if sorting is enabled it automatically gets sorted after drag end.
- you can't sort manually by defining a function in your parent component where you defined draggable thingy.
Expected Solution
- so basically it would be great if we can handle custom sorting by emitting an event suppose the name would be
handle-sort - that handle sort event will pass the previous index and future index of the dragged element
- and the parent component's sorting method will receive that event and sort list array accordingly