[Vuejs]-Generating static files with relative paths with Nuxt

0👍

If you load picture from assets directory, files have dynamic paths depending on where they are currently loaded. you can generate a path with the help of a webpage:

<img :src="require('~/assets/images/image.png)">

On the other hand, in case of static directory – files are copied to the main directory, that’s why you’re using the path from the main location e.g.

<img src="images/image.png">

Leave a comment