4👍
You need to provide key in the v-for tag.
<app-card v-for="item in cards" :key="item.id"></app-card>
or
<app-card v-for="(item,index) in cards" :key="index"></app-card>
1👍
As error saying itself, :key
directive is missing as it should be there while working with v-for
.
You don’t need a
key
attribute in order to usev-for
, but it’s a good practice, that’s why editor intelligence is telling you to add.
Please have a read of the official documentation of vue.js regarding maintaining state while using v-for
.
Source:stackexchange.com