Vue: Add v-bind:key directive in every v-for

This commit is contained in:
Marco Realacci 2022-12-24 20:40:41 +01:00
parent 055bdcabff
commit cb5d6774e2
4 changed files with 4 additions and 4 deletions

View file

@ -120,7 +120,7 @@ export default {
</div>
</div>
<div v-if="comments_shown">
<div v-for="item of comments_data" class="row">
<div v-for="item of comments_data" class="row" v-bind:key="item.comment_id">
<div class="col-7 card-body border-top">
<b>{{ item.name }}:</b> {{ item.comment }}
</div>

View file

@ -61,7 +61,7 @@ export default {
<br />Why don't you start following somebody? 👻
</div>
<div id="main-content" v-for="item of stream_data">
<div id="main-content" v-for="item of stream_data" v-bind:key="item.photo_id">
<PostCard :user_id="item.user_id" :photo_id="item.photo_id" :name="item.name" :date="item.date"
:comments="item.comments" :likes="item.likes" :liked="item.liked" />
</div>

View file

@ -94,7 +94,7 @@ export default {
</div>
</div>
<div id="main-content" v-for="item of stream_data">
<div id="main-content" v-for="item of stream_data" v-bind:key="item.photo_id">
<PostCard :user_id="requestedProfile" :photo_id="item.photo_id" :name="user_data['name']"
:date="item.date" :comments="item.comments" :likes="item.likes" :liked="item.liked" />
</div>

View file

@ -73,7 +73,7 @@ export default {
<label class="form-label" for="formUsername">Search by username</label>
</div>
<div id="main-content" v-for="item of streamData">
<div id="main-content" v-for="item of streamData" v-bind:key="item.user_id">
<UserCard :user_id="item.user_id" :name="item.name" :followed="item.followed"
:banned="item.banned" />
</div>