[Vuejs]-Vue.js item doesn't get deleted from array

1👍

From your child component Box.vue, you’re emitting event named "deletebox", and in your parent component you’re catching an event named "delete" (@delete)

Try changing in you parent component an event listener to @deletebox, like this:

App.vue

<box 
    v-for="box in boxes" 
    :key="box.id"
    :id="box.id"
    :name="box.name"
    :number="box.number"
    @deletebox="deleteBox($event)">
</box>
👤equi

Leave a comment