Open AnoRebel opened 3 years ago
I've got a near identical setup to this with the exact same issue.
VueX store that's version 4.0 and VueJS that is V3.
Both draggable components are using the same name, the item keys are correct and the VueX get/set methods are correct.
Seems to be coming from the fatherNode not having the children property set/populated.
+1
Getting the exact same error. This is frustrating! Anyone have a quick fix for this? Is there a version of vue-draggable for Vue 3 that does not have this issue?
EDIT: The issue seems to be with the transition tag. Remove that and it works again.
@MariusTechweb I got the same problem yesterday, and i just change to this package "vue-draggable-next" and it works without any trouble, you will only remove the <template>
tag ( you need to remove it).
@roonie007 Thank you. Anyways, after hours of debugging I got it working. The issue was apparently there's a bug with using tag="transition-group" on draggables you wish to drag between.
Removing the transition group tag worked for me too, just means this is running without any transitions. Snippets below if anyone needs an example.
Original Code:
<draggable v-model="column.cards" group="board" item-key="id" tag="transition-group" :component-data="{name:'fade'}">
<template #item="{element}">
<board-card :card="element"/>
</template>
</draggable>
Fixed Code:
<draggable v-model="column.cards" group="board" item-key="id">
<template #item="{element}">
<board-card :card="element"/>
</template>
</draggable>
@Charlesbjerg I figured you can get the flip animation if you set the prop :animation="500" on the draggable component. Apparently sortable comes with this animation if set. 500 = animation duration in milliseconds.
Submitted pull request #52 to resolve this.
same problem
same problem
I use the latest Vue 3(3.0.11) and Vuex 4(4.0.0). Sorry, couldnt create a quick one. But below is the basic of the component and some of its scripts.
The Component:
The Templist value:
The Store:
Step by step scenario
Create an app, create a store. Add my different lists to the store. Call the lists in a custom draggable component i made(which is basically just a draggable that i can reuse with same values except the passed list from store)
Actual Solution
Dragging within the same list element/draggable (i.e sorting) works. But dragging to the other list(with the same group name) breaks the whole component(becomes unresponsive). The console logs out the error:
Expected Solution
To be able to move from one list to the other without a problem
Any help will be quite useful for I'm to both vue and vuex.