Open
Description
I have some images that are only specifically displayed on mobile/desktop. With the regular <img />
tag, setting them to display: none
will not load any images. But with <NuxtImg />
, the image also gets fetched, even though it's never displayed. This costs some unnecessary bandwith for mobile users.
Reproduction
https://stackblitz.com/edit/github-p3cr3h?file=nuxt.config.ts,app.vue
Workarounds
- Doing a
v-if
and listening to the screen size in JavaScript. That would not be good for initial loading and SEO. - Adding
loading="lazy"
which will also not be good since the images are in the first loading viewport (in my case)