1👍
✅
That’s because your index is binded as a key
. Try adding an id
variable (unique for every comment, it can be an incrementing number or a random string) and use that as your key
in v-for
.
Example:
feedbackList: [
{id: 'nlgvn5d6', name: 'John', comment: 'a nice comment'},
{id: '85m18efd', name: 'Steve', comment: 'first comment'}
]
Remeber that when adding a new item to the list it also needs to have its own unique id.
Then you can use it like this:
v-for="comment in feedbackList" :key="comment.id"
Source:stackexchange.com