vue3-draggable
vue3-draggable copied to clipboard
Broken reactivity ? How to remove item ?
Reactivity seems broken
if I splice the v-model list from the parent; the draggable component is not updated.
There is also no example of removing a list item in your example.
Only way I can get it to update is to use a v-if
on <draggable>
component with a long enough delay
Is a watcher missing on the v-model modelValue
?
watch: { modelValue() { if (this.modelValue){ this.list = this.modelValue } }, }
Also running into this issue.
When using the following code on the example code.
const removeItem = (item) => {
items1.value = items1.value.filter(i => i.value !== item)
}
it removes it from the
<pre>{{ JSON.stringify(items1, undefined, 4) }}</pre>
but the value stays on the draggable