1

I have an array with some object and each object has an image tag, so i want to show this images but i dont know how i think the mistake is in the src of image.. Its my code in file in folder components its Template :

<div v-for="(item, index) in items" :key="index">
 <div v-html="item.image"></div>
</div>

And its script

data(){
 return {
  items: [
    {title : 'IMG1', image : '<img src="../assets/img1.jpg" alt="None">',},
    {title : 'IMG2', image : '<img src="../assets/img2.jpg" alt="None">',}
  ]
 }
}

But its just show None.. please how can i get this images?! its my folder directory im in file posts.vue and i wanna get images in assets/images

enter image description here

Rawand
  • 41
  • 6

1 Answers1

0

have you tried using an image tag? Like <img :src="item.image" alt="none" />. and have your image in data as just a string like "../assets/img1.jpg".