我也发现了删除的问题,只要修改前端的语法就解决了,修改如下两个文件:
main.js
removeTodo (store, {todo, index}) {
Vue.axios.delete('http://laravel-vue.app/api/todo/'+ todo.id + '/delete').then(response => {
console.log(response.data)
store.commit('delete_todo',index)
})
},
todos.vue
deleteTodo (todo, index){
this.$store.dispatch('removeTodo', {todo, index})
},