vue3-draggable icon indicating copy to clipboard operation
vue3-draggable copied to clipboard

Broken reactivity ? How to remove item ?

Open signmeuptwice opened this issue 3 years ago • 1 comments

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 } }, }

signmeuptwice avatar Oct 29 '21 16:10 signmeuptwice

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

Fanna1119 avatar Nov 30 '21 10:11 Fanna1119