Open salazarr-js opened 2 years ago
Same problem here. Are there any solutions/ workarounds for getting a NodeList from the draggable component?
I've been looking an answers on how to use refs
with the next
version of vuedraggable but I cannot find it online. By following the v-for Array Refs
documentation I came up with this solution. See stackblitz example
https://stackblitz.com/edit/nuxt-starter-gcqtdj?file=app.vue
following the v-for array refs and the template ref array with composition API examples I found that the
template references array
doesn't work as expected like withv-for
, so we can't have acces correctly to the draggable elements references on the scriptπ©π»βπ¬ I used the base
vite-vue-ts
template to replicate the issue in this stackblitz, the two componentsVForRefs.vue
andDraggableRefs.vue
shows the working v-for example and the other one using thevuedraggable
componentπ₯ we should have access to the elements ref, but the
beforeUpdate
and theupdated
lifecycle hooks doesn't seems to be triggered properly after modify theelements
list when using composition APIreactive
andref
System info
macOS
v11.2.3
Nodev16.13.1
npm8.1.2
Packages
vue
3.2.25
vuedraggable4.1.0
Builder
vite
2.7.2
@vitejs/plugin-vue2.0.0
typescript4.4.4
vue-tsc0.29.8
Browser
Chrome
97.0.4692.99