Open n-skriabin opened 3 years ago
The bug occurs frequently!!!
I get similar issue..
I am using
"quasar": "^2.6.0", "vue": "^3.0.0", "vuedraggable": "^4.1.0"
and a simple code
<Draggable v-model="state.destinations"
@start="state.isDragging = true"
@end="state.isDragging = false"
item-key="id"/>
...
</Draggable>
...
<script setup>
import Draggable from 'vuedraggable'
I stumbled across this problem
The solution that worked for me: vuedraggable is based on Sortable.js we are supposed to embed sortable.js before vuedraggable like this:
<script src="{% static "global/sortablejs-1.8.4/Sortable.min.js" %}"></script>
<script src="{% static "global/Vue.Draggable/2.20.0/vuedraggable.umd.min.js" %}"></script>
In my case i forgot to use this: <script src="{% static "global/sortablejs-1.8.4/Sortable.min.js" %}"></script>
, once I did everything worked perfectly.
The following error appears when initializing the draggable list. 'Cannot read property 'option' of undefined'.
(You can see in the following screenshot)
After debugging, I found that the watcher is triggered before the mounted method, thus _sortable in 'mounted' is undefined.
Is it possible to fix this somehow? Thank you.