Ir al contenido

V-For Key (ARCH3324)

Esta página aún no está disponible en tu idioma.

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>