vue array item splice transition removes last item code example
Example: vue array item splice transition removes last item
// This happens when you set them item key to index
// Wrong:
<div v-for="(item, index) in array" :key="index"></div>
// Correct
array = [{
item: 'example',
id: 'unique-id'
}]
...
<div v-for="(item, index) in array" :key="item.id"></div>
// The item key is incorrect.
// Generate a unique id for each item