0👍
Have you tried referencing the assets directory relatively?
Like so:
<img :src="'@/assets/kaarten/' + card.img + '.png'"/>
Also, the card.show
variable is true, isn’t it?
- [Vuejs]-How to display data in vuetify datatable
- [Vuejs]-Asp.net Core Web API – Downloading multiple images from blob storage to zip file (via Axios get)
0👍
You need to require the path, like this:
<img v-if="card.show" :src="require('../../src/assets/kaarten/' + card.img + '.png')">
or better yet, use template literals for clarity:
<img v-if="card.show" :src="require(`../../src/assets/kaarten/${card.img}.png`)">
Source:stackexchange.com