I am new to vue.js (2) and I am currently working on a simple event app. I\'ve managed to add events but now I would like to delete events based on clicking on a button.
Don't forget to bind key attribute otherwise always last item will be deleted
Correct way to delete selected item from array:
Template
delete script deleteItem(index) { this.items.splice(index, 1); \\OR this.$delete(this.items,index) \\both will do the same } 0 讨论(0) 查看其它8个回答 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复
script
deleteItem(index) { this.items.splice(index, 1); \\OR this.$delete(this.items,index) \\both will do the same }