I have developed an application using vue-CLI with bootstrap-vue integration. Within my App.vue file, I am utilizing axios to fetch sample JSON data. The objective is to create a list using the b-list-group-item (from Bootstrap) and assign a key to each element using v-bind:key="result.ItemId". However, this key binding does not seem to work as expected. When inspecting the HTML code, no "key" attribute is rendered.
Below is the snippet of code in question:
<b-list-group>
<b-list-group-item
href="#"
class="flex-column align-items-start"
v-for="result in post"
v-bind:key="result.ItemId"
>
<div class="d-flex w-100 justify-content-between">
<h6 class="mb-1">{{ result.ItemHeading }}</h6>
<small>{{ result.ItemSubHeading }}</small>
</div>
<p class="mb-1">{{ result.ItemDetails }}</p>
</b-list-group-item>
</b-list-group>
Here is the displayed HTML without key bindings:
https://i.sstatic.net/FlsJC.png
This is the resulting JSON data:
0: {ItemId: "10075328", ItemHeading: "news im November", ItemSubHeading: "unter news",…}
Date4Itemnew: "24.11.2019"
ItemDetails: "lorem ipsum"
ItemHeading: "news im November"
ItemId: "10075328"
ItemSubHeading: "unter news"
u_date: "1574550000"
I have attempted various methods to bind the key without success. Any assistance would be greatly appreciated.