我试图使用 $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);
},
这是我的示例数据
这是我的控制台