add eslint working conf
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
</div>
|
||||
<ToDo v-else
|
||||
v-for="(toDo, indexToDo) in toDoList.data.attributes.data.to_dos.data"
|
||||
key="indexToDo"
|
||||
:key="indexToDo"
|
||||
:toDo="toDo"
|
||||
:position="indexToDo" />
|
||||
</ul>
|
||||
@@ -23,54 +23,56 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import InputField from "../../components/InputField";
|
||||
import ToDo from "./ToDo";
|
||||
import InputField from '../../components/InputField'
|
||||
import ToDo from './ToDo'
|
||||
|
||||
export default {
|
||||
name: "ToDoList",
|
||||
components: {
|
||||
InputField, ToDo
|
||||
export default {
|
||||
name: 'ToDoList',
|
||||
components: {
|
||||
InputField, ToDo
|
||||
},
|
||||
data: function () {
|
||||
return {
|
||||
name: '',
|
||||
errors: null,
|
||||
list: null,
|
||||
edit: false,
|
||||
}
|
||||
},
|
||||
props: {
|
||||
toDoList: {
|
||||
type: Object,
|
||||
require: true
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.list = this.$el.querySelector('.draggable-list')
|
||||
console.log(this.list)
|
||||
},
|
||||
methods: {
|
||||
addToDo: function () {
|
||||
// eslint-disable-next-line no-undef
|
||||
axios.post('/api/to-do-lists/' + this.toDoList.data.to_do_list_id + '/to-do', {name: this.name})
|
||||
.then(res => {
|
||||
this.toDoList.data.attributes.data.to_dos.data.push(res.data)
|
||||
this.name = ''
|
||||
})
|
||||
.catch(errorRes => {
|
||||
console.log('Internal Error, Unable to delete contact.' + errorRes)
|
||||
})
|
||||
},
|
||||
data: function () {
|
||||
return {
|
||||
name: '',
|
||||
errors: null,
|
||||
list: null,
|
||||
edit: false,
|
||||
}
|
||||
},
|
||||
props: {
|
||||
toDoList: {
|
||||
type: Object,
|
||||
require: true
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.list = this.$el.querySelector('.draggable-list')
|
||||
console.log(this.list)
|
||||
},
|
||||
methods: {
|
||||
addToDo: function () {
|
||||
axios.post('/api/to-do-lists/' + this.toDoList.data.to_do_list_id + '/to-do', {name: this.name})
|
||||
.then(res => {
|
||||
this.toDoList.data.attributes.data.to_dos.data.push(res.data)
|
||||
this.name = ''
|
||||
})
|
||||
.catch(errorRes => {
|
||||
console.log('Internal Error, Unable to delete contact.' + errorRes)
|
||||
})
|
||||
},
|
||||
deleteToDo: function (toDo, position) {
|
||||
axios.delete('/api/to-do-lists/' + this.toDoList.data.to_do_list_id + '/to-do/' + toDo.data.to_do_id)
|
||||
.then(res => {
|
||||
this.toDoList.data.attributes.data.to_dos.data.splice(position, 1)
|
||||
})
|
||||
.catch(errorRes => {
|
||||
console.log('Internal Error, Unable to delete contact.' + errorRes)
|
||||
})
|
||||
}
|
||||
deleteToDo: function (toDo, position) {
|
||||
// eslint-disable-next-line no-undef
|
||||
axios.delete('/api/to-do-lists/' + this.toDoList.data.to_do_list_id + '/to-do/' + toDo.data.to_do_id)
|
||||
.then(() => {
|
||||
this.toDoList.data.attributes.data.to_dos.data.splice(position, 1)
|
||||
})
|
||||
.catch(errorRes => {
|
||||
console.log('Internal Error, Unable to delete contact.' + errorRes)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user