N
Nuxt2y ago
Helgi

Trouble with dynamic assets

I'm trying to dynamically fetch assets but there seems to be an issue with Vite. I've tried a lot of different variations, but none seem to work. Is there any Vite config I have to do? Some of the variations I've tried:
<img :src="`~/assets/${step.img}`" />
<img :src="`~assets/${step.img}`" />
<img :src="`@/assets/${step.img}`" />
<img :src="`assets/${step.img}`" />
<img :src="`/assets/${step.img}`" />
<img :src="`~/assets/${step.img}`" />
<img :src="`~assets/${step.img}`" />
<img :src="`@/assets/${step.img}`" />
<img :src="`assets/${step.img}`" />
<img :src="`/assets/${step.img}`" />
No description
5 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Helgi
HelgiOP2y ago
I was hoping to understand how I could dynamically access images in the assets folder instead of using an alternate approach. Or does this mean that accessing images from the assets folder is not a nuxt3 thing?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Helgi
HelgiOP2y ago
Ok, so the public folder is the way to go. But out of curiosity, how would I reconfigure Vite to allow this?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server