Skip to content

Instantly share code, notes, and snippets.

@codemwnci
Created August 25, 2017 21:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codemwnci/451a5fdffe0147461eecf9c2d688b0fe to your computer and use it in GitHub Desktop.
Save codemwnci/451a5fdffe0147461eecf9c2d688b0fe to your computer and use it in GitHub Desktop.
delete todo function
deleteTodo: function(id) {
axios.delete("http://localhost:9000/todo/"+id).then(response => {
if (response.data = "ok") {
for(var i = this.todos.length; i--;){
if (this.todos[i].id === id) this.todos.splice(i, 1);
}
}
});
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment