I'm trying to render four images using v-for with a range, 1 to 4.
v-for="n in 4" :key"n"
But, using 'n' as part of src does not work. Why?
<div v-for="n in 4" :key="n">
<img
:src="`../assets/images/image-product-${n}-thumbnail.jpg`"
class="rounded-xl h-16 w-16 hover:cursor-pointer"
/>
</div>
Tried using 'key' instead of 'n', converting 'n' to string... none worked
If I hardcorde like this, it works
<img
src="../assets/images/image-product-1-thumbnail.jpg"
class="rounded-xl h-16 w-16 hover:cursor-pointer"
/>