Aller au contenu

V-For Key (ARCH3324)

Ce contenu n’est pas encore disponible dans votre langue.

Key typescript.vue.v-for-key · Severity warning · Category quality

Vue: flags a v-for with no :key. Vue then patches list nodes by position, so DOM state (focus, input text, transitions) stays with the slot instead of the item.

<li v-for="item in items">{{ item.name }}</li>
<li v-for="item in items" :key="item.id">{{ item.name }}</li>