3👍
✅
Continuing from comments.. you can just delete the item
and let the re-render remove the old DOM for you.
E.g. change your handler to pass the current item reference:
v-on:click.prevent="deleteItem(item)"
Then filter it out in your deleteItem
method:
deleteItem(item) {
this.items = this.items.filter(it => it !== item);
}
Full example: https://codepen.io/anon/pen/POGgWp
👤Matt
Source:stackexchange.com