refactor: single key on template v-for

This commit is contained in:
axolotle 2024-03-04 04:20:02 +01:00
parent fdbe64cf95
commit 03b136478a
5 changed files with 13 additions and 15 deletions

View file

@ -1,8 +1,7 @@
<template>
<BListGroup :flush="flush" :style="{ '--depth': tree.depth }">
<template v-for="(node, i) in tree.children">
<template v-for="(node, i) in tree.children" :key="node.id">
<BListGroupItem
:key="node.id"
class="list-group-item-action"
:class="getClasses(node, i)"
@click="$router.push(node.data.to)"
@ -26,7 +25,6 @@
<BCollapse
v-if="node.children"
:key="'collapse-' + node.id"
v-model="node.data.opened"
:id="'collapse-' + node.id"
>

View file

@ -4,8 +4,8 @@
<BSkeleton width="30%" height="36px" class="m-0" />
</template>
<template v-for="count in itemCount">
<BRow :key="count" :class="{ 'd-block': cols === null }">
<template v-for="count in itemCount" :key="count">
<BRow :class="{ 'd-block': cols === null }">
<BCol v-bind="cols">
<div style="height: 38px" class="d-flex align-items-center">
<BSkeleton
@ -32,7 +32,7 @@
</BCol>
</BRow>
<hr :key="count + '-hr'" />
<hr />
</template>
<template #footer>

View file

@ -96,8 +96,8 @@
:title="$t('group_specific_permissions')"
icon="group"
>
<template v-for="(userName, index) in activeUserGroups">
<BRow :key="userName">
<template v-for="userName in activeUserGroups" :key="userName">
<BRow>
<BCol md="3" lg="2">
<YIcon iname="user" /> <strong>{{ userName }}</strong>
</BCol>
@ -116,7 +116,7 @@
/>
</BCol>
</BRow>
<hr :key="index" />
<hr />
</template>
<TagsSelectizeItem

View file

@ -70,12 +70,12 @@
</BButton>
</template>
<template v-for="({ filename, content }, i) in logs">
<h3 :key="i + '-filename'">
<template v-for="{ filename, content } in logs" :key="filename">
<h3>
{{ filename }}
</h3>
<pre :key="i + '-content'" class="log"><code>{{ content }}</code></pre>
<pre class="log"><code>{{ content }}</code></pre>
</template>
</YCard>
</ViewBase>

View file

@ -1,8 +1,8 @@
<template>
<CardForm :title="$t('tools_webadmin_settings')" icon="cog" no-footer>
<template v-for="(field, fname) in fields">
<FormField v-bind="field" v-model="self[fname]" :key="fname" />
<hr :key="fname + 'hr'" />
<template v-for="(field, fname) in fields" :key="fname">
<FormField v-bind="field" v-model="self[fname]" />
<hr />
</template>
</CardForm>
</template>