Reputation: 1063
I have a super weird problem here, I want to use a for-loop (using v-for
) for images inside /static
.
Strangely, using v-img
only works if it's used in conjunction with img
. I'd like to strictly use v-img
for easy formatting and continuance.
Here is my code(s) and a screenshot for each example:
v-img
<div v-for="(image, index) in images" :key="index">
<v-img :src="image.src"></v-img>
</div>
img
<div v-for="(image, index) in images" :key="index">
<img class="image" :src="image.src" :alt="image.alt">
</div>
Images are displayed with standard img
properties.
v-img
and img
<div v-for="(image, index) in images" :key="index">
<v-img :src="image.src"></v-img>
<img class="image" :src="image.src" :alt="image.alt">
</div>
Images are displayed from both v-img
and img
.
Upvotes: 1
Views: 1058
Reputation: 43
I have given an example on codepen
<v-img v-for="image in images" :src="image.src" aspect-ratio="2"/>
this works for me
Upvotes: 1
Reputation: 584
You can try this <v-img :src="require('image.src')"></v-img>
I hope it helps.
Upvotes: 0