Permalink
Browse files

DELETE todo list on @click event

  • Loading branch information...
amejiarosario committed Aug 13, 2018
1 parent 4af7d31 commit a73e058107e71634e875d949f9272872c606ec09
Showing with 5 additions and 1 deletion.
  1. +4 −0 app.js
  2. +1 −1 index.html
4 app.js
@@ -27,5 +27,9 @@ const todoApp = new Vue({
cancelEditing() {
this.editing = null;
},
destroyTodo(todo) {
const index = this.todos.indexOf(todo);
this.todos.splice(index, 1);
},
}
});
@@ -27,7 +27,7 @@ <h1 v-text="title"></h1>
<div class="view">
<input class="toggle" type="checkbox" v-model="todo.isDone">
<label @dblclick="startEditing(todo)">{{todo.text}}</label>
<button class="destroy"></button>
<button class="destroy" @click="destroyTodo(todo)"></button>
</div>
<input class="edit"

0 comments on commit a73e058

Please sign in to comment.