[Vuejs]-How can I debug this dublicate error (Vue.js 2)

0👍

Your duplicate key error is because you’re using the same key more than once in your code:

:key="vers.Id"

If your Id for example is 1, your :key is vers.1. You’re doing this more than once in your HTML so there are multiple keys with the same Id, hence duplicate the duplicate Id error.

You could do:

:key="vers.Id + Math.random()"

Or provide a HTML id and add that to the id, for example:

:key="vers.Id + 'div1'" id="div1"
:key="vers.Id + 'div2'" id="div2"

etc.

Leave a comment