[Vuejs]-Eslint error when compiling vue file with loop

1๐Ÿ‘

โœ…

I would reccomend to address and fix the error ๐Ÿ™‚

The error is telling you that a key binding is missing, this helps Vue to track each item. See more at: https://vuejs.org/guide/essentials/list.html#maintaining-state-with-key

So simply add the key directive and set the value to something unique.

<section
    class="flex flex-col items-center pb-8"
    v-for="project in projects"
    :key="project.name"
>

Assuming the name is unique, you could also add an id property to your json file and use that as a key.

๐Ÿ‘คBergur

Leave a comment