-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
Closed
Description
Vue.js version
2.1.10
Reproduction Link
Steps to reproduce
- Start with an array of items and slice a subset from that array.
- Using
v-for
, loop through that subset in a template and render some elements. Make sure you set:key
props on those elements and pass consistent IDs to track which element belongs to which item. - Change the subset by changing the position where it is sliced from the array of items.
What is Expected?
If I understand how :key
is supposed to work, items should be matched to elements based on their unique id. When items are updated (some added/removed, some left intact), the ones that remain should stay in the same elements for animation purposes.
What is actually happening?
The reuse of elements is inconsistent. In the demo fiddle, when clicking up, a transition is triggered, which means the items remained in the same elements as expected. But clicking down instantly changes all values, which hints that new elements were created.
honeyjie
Metadata
Metadata
Assignees
Labels
No labels