Closed
Description
This is my parent vue component which is repeats this child component
<v-feed-item v-for="(post, index) in posts" :post="post" :user="user" v-on:item-deleted="posts.splice(index, 1)"></v-feed-item>
in the feed item template component i'm using $emit function to access the v-on:item-deleted
posts.splice is causing the last item in the array to be removed, i've also tried calling a function similar to below example but exactly the same result, i can even console log and get the desired index that i would like to be removed. Is this a genuine bug? My template code in child item is pretty complex but i even tried making it absolutely minimal but still same result...
onDelete: function (item, index) {
var self = this;
let idx = self.posts.indexOf(item);
self.posts.splice(idx, 1);
}
Metadata
Metadata
Assignees
Labels
No labels