【发布时间】:2017-03-21 04:15:16
【问题描述】:
我正在尝试使用 $remove 删除数组元素。但它说 this.posts.$remove 不是一个函数。谁能解释我哪里错了?
<button type="button" class="btn btn-danger" @click="deletePost(post.id)">Xxx</button>
vue 实例:
deletePost(postId){
console.log(postId);
this.posts.$remove(postId);
},
这是我的示例数据
这是我的控制台
【问题讨论】:
标签: javascript arrays vue.js vuejs2