Should i load SVG files with @nuxt/image or use a simple img tag? #1218
Unanswered
oemer-aran
asked this question in
Q&A
Replies: 1 comment
-
I’d suggest inlining them as Vue components with import svgLoader from 'vite-svg-loader'
export default defineNuxtConfig({
vite: {
plugins: [
svgLoader(),
],
},
}) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Comparison
With
img
tagusing
string
:or using import (only relevant for local images):
With
nuxt-img
only
string
possible:My thoughts
nuxt-img
ornuxt-picture
for every image keeps the code consistent and easy to understandimg
tag for.svg
files would save an unnecessary request to the ipx endpointimg
tag allows to use imported.svg
What is your opinion? Is there an official recommendation?
Beta Was this translation helpful? Give feedback.
All reactions