#How to render image dynamically in Nuxt?

3 messages · Page 1 of 1 (latest)

old quiver
#
<span class="font-semibold">
  {{ item.title }}
<img :src="`@/assets/images/${activeIndex === index ? 'minus' : 'plus'}.webp`" class="w-4 h-4" />
</span>

The page renders but the image does not display

cloud dew
#

Have you tried to put the images into the public folder and use a relative URL to access them?

<img :src="`/images/${activeIndex === index ? 'minus' : 'plus'}.webp`" class="w-4 h-4" />