fix checked input status after move

This commit is contained in:
2020-08-01 16:27:09 +02:00
parent 783f9c14fc
commit 117ed6cfdc
2 changed files with 23 additions and 13 deletions

View File

@@ -43,6 +43,7 @@
<svg-vue icon="draggable" class="w-4 block mr-2 cursor-move" />
<ToDo :to-do="toDo"
:id-list="toDoList.data.to_do_list_id"
ref="toDo"
class="flex-1 bg-blue" />
<span @click="deleteToDo(toDo, index)" class="cursor-pointer ml-2 font-bold edit-icon flex items-center">
<svg-vue icon="close" class="w-4" />
@@ -87,7 +88,7 @@ export default {
this.toDoList = res.data
this.loading = false
this.listName = res.data.data.attributes.data.name
this.reorderList()
this.sortList()
})
.catch(errorRes => {
this.loading = false
@@ -120,11 +121,14 @@ export default {
console.log('Internal Error, Unable to delete contact.' + errorRes)
})
},
reorderList() {
sortList() {
this.toDoList.data.attributes.data.to_dos.data.sort(function(a, b) {
return a.data.attributes.data.order - b.data.attributes.data.order
})
},
reorderList() {
this.sortList()
},
addToDo: function () {
if(this.toDoName.length >= 3) {
// eslint-disable-next-line no-undef