[Vuejs]-Template cannot be keyed. Place the key on real elements instead

1👍

<template> tags are removed when the component renders. That’s why you should pass key attribute to the child element (which is real).

<template v-for="(url, index) in urlList">
  <Image :key="url" :src="url" />
</template>

You can also use v-for directly on <Image>

<Image 
  v-for="(url, index) in urlList" 
  :key="url" 
  :src="url" 
/>

Leave a comment