[Vuejs]-How can I use svg's in Nuxt with Vue.js without importing them?

2👍

If svg is in the assets folder, simply writing the path will not work
Because it goes through webpack
https://nuxtjs.org/docs/2.x/directory-structure/assets#images

:src="require('~/assets/...')"

1👍

Try this when it’s in the static directory:

<img src="/vector/icons/flags/united_kingdom.svg" width="70" height="38" />

When you wanna reference static files inside HTML you can simply reference them with a forward slash.

Leave a comment