Move key to component where v-for is defined (#15944)

This commit is contained in:
Nicola Krumschmidt
2022-10-11 23:57:54 +02:00
committed by GitHub
parent 3c2125f646
commit 1a5d635efb
2 changed files with 3 additions and 5 deletions

View File

@@ -9,7 +9,7 @@
<v-info v-if="noVisibleFields && !nested && !loading" :title="t('no_visible_fields')" icon="search" center>
{{ t('no_visible_fields_copy') }}
</v-info>
<template v-for="(fieldName, index) in fieldNames">
<template v-for="(fieldName, index) in fieldNames" :key="fieldName">
<component
:is="`interface-${fieldsMap[fieldName]?.meta?.interface || 'group-standard'}`"
v-if="fieldsMap[fieldName]?.meta?.special?.includes('group')"
@@ -19,7 +19,6 @@
formFieldEls[fieldName] = el;
}
"
:key="fieldName + '_group'"
:class="[
fieldsMap[fieldName]?.meta?.width || 'full',
index === firstVisibleFieldIndex ? 'first-visible-field' : '',
@@ -48,7 +47,6 @@
formFieldEls[fieldName] = el;
}
"
:key="fieldName + '_field'"
:class="index === firstVisibleFieldIndex ? 'first-visible-field' : ''"
:field="fieldsMap[fieldName] || {}"
:autofocus="index === firstEditableFieldIndex && autofocus"

View File

@@ -1,6 +1,6 @@
<template>
<template v-for="(part, index) in parts">
<mark v-if="part.highlighted" :key="index" class="highlight">{{ part.text }}</mark>
<template v-for="(part, index) in parts" :key="index">
<mark v-if="part.highlighted" class="highlight">{{ part.text }}</mark>
<template v-else>{{ part.text }}</template>
</template>
</template>