use :list with computed prop
See original GitHub issuealready saw https://github.com/SortableJS/Vue.Draggable/issues/52 but i have a slightly diff example, check https://codepen.io/ctf0/pen/BwLezW
when using colorsList
as computed prop, i can omit the watchers, mounted()
and make the code much cleaner,
so when trying to drag while using computed, only the first item gets dragged , but from second item on i get an error that computed prop doesnt have a setter.
i thought i could use the computed prop for v-model
and use :list
with some other empty array, so now the sorting can be cloned and saved into this new array, but that didnt work.
so is there anyway to use computed prop with :list
?
on a side note
when releasing a dragged item, there is a quick flicker of the old in-place item, try to re-sort the bubbles in the example and watch what happens for the colors b4 the sort gets applied.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:7 (3 by maintainers)
@phaberest as mentioned in this issua as well as in #52 , computed is not supported and could not be supported use provided work-around instead.
I just needed to change the data in the main object when saving. Using
:list
for my computed andv-model
for my original non filtered object works fine.If anyone ever need it, this is what I did: (
shownStages
is my computed)