[Vuejs]-$Emit is passing "undefined" property instead of an int property?

0👍

Well, it looks like items is an array

this.items = this.items.filter(item => item.id !== id, res.data))

so you either need to do

@click="$emit('del-data', items[0].id)" 

or

this.items = this.items.find(item => item.id === id, res.data))

Leave a comment