2016-11-07 117 views
2

即時嘗試刪除數組元素使用$刪除。但它說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); 
     }, 

這是我的示例數據

my data

這是我的控制檯

enter image description here

回答