Answer the question
In order to leave comments, you need to log in
What's wrong with transition-group or why "children must be keyed"?
I can't figure out why transition-group doesn't want to work here?
<transition-group name="collapse">
<div class="customers">
<SimpleCustomer v-if="!collapse" :customer="contact.last_deal_with" />
<div class="customers--list" v-else>
<SimpleCustomer :customer="membership.customer" :contact="contact.id" :person-post="membership.post" :collapse="collapse" :edit="edit" v-for="(membership, i) in memberships" :key="membership.customer.id"/>
</div>
<CreateMembership @addNewCustomer="addNewCustomer" :memberships="memberships" v-show="edit" :contact="contact"/>
</div>
</transition-group>
Answer the question
In order to leave comments, you need to log in
When Vue is updating a list of elements rendered with v-for, by default it uses an “in-place patch” strategy. If the order of the data items has changed, instead of moving the DOM elements to match the order of the items, Vue will patch each element in-place and make sure it reflects what should be rendered at that particular index. This is similar to the behavior of track-by="$index" in Vue 1.x.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question