0

I have checked many examples from stack overflow but I am still struggling to understand where did I make the mistake. So, with the event bus, I am retrieving the item id I need to delete. I have checked and the id is coming without any issues. the problem is that I cannot filter out the item where id is equal to the id I am getting back from the click event. This is the code:

export default {
data() {
    return {
        quotes: [
            { id: 1, content: 'First quote'},
            { id: 2, content: 'Second quote'},
        ]
    }
},
created() {
    eventBus.$on('deleteQuote', (providedId) => {
        this.quotes.filter((quote) => quote.id === providedId);
    });
}

}

Luka
  • 171
  • 1
  • 1
  • 19

0 Answers0