primefaces / sakai-vue-cli

Free Vue Admin Template by PrimeVue
https://www.primefaces.org/sakai-vue
MIT License
452 stars 204 forks source link

Wrong :key used for Message demo? #40

Open space88man opened 2 years ago

space88man commented 2 years ago

In MessagesDemo.vue, demo'ing the Message component

<transition-group name="p-message" tag="div">
    <Message v-for="msg of message" :severity="msg.severity" :key="msg.content">{{msg.content}}</Message>
</transition-group>

the :key should be msg.id. If you don't change the content, e.g. click 'Success', dismiss the Message, click 'Success' again — change detection does not work — the element is not re-rendered.