Answer the question
In order to leave comments, you need to log in
Reorder array elements on drag-n-drop?
Hello. A list of tasks that is taken from the VUEX repository, tasks can be rearranged by drag-n-drop. How to update the array in storage depending on the position of the task at the moment. Todo list
Answer the question
In order to leave comments, you need to log in
We include
Vue.Draggable .
Add a setter to the allTasks computed property:
allTasks: {
get() {
return this.$store.state.tasks;
},
set(val) {
this.$store.commit('allTasks', val);
},
},
draggable.tasks__wrap(v-model="allTasks")
...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question