vue array item splice transition removes last item

Solutions on MaxInterview for vue array item splice transition removes last item by the best coders in the world

showing results for - "vue array item splice transition removes last item"
Cleo
05 Jul 2019
1// This happens when you set them item key to index
2
3// Wrong: 
4<div v-for="(item, index) in array" :key="index"></div>
5
6// Correct
7array = [{
8	item: 'example',
9	id: 'unique-id'
10}]
11...
12<div v-for="(item, index) in array" :key="item.id"></div>
13
14// The item key is incorrect.
15// Generate a unique id for each item
16
17
similar questions