Preloading images in Nuxt 3 - #vuejs #nuxtjs

preview_player
Показать описание
Eliminate glitches by preloading images. Make sure to not over do it though.
Рекомендации по теме
Комментарии
Автор

I can also suggest replacing v-if with v-show. That way, images will be loaded on background, since, with v-show the DOM is actually rendered, just not shown.

jaker
Автор

Always specify height/width on images too where possible so browsers can prevent CLS

bringbackwindowsphone
Автор

You can also keep things performant and load the image when the user hovers, and if the image is a smaller size, it will definitely load before the user decides to click. If you are worried about it still glitching, you can preset the determined ratio based on the image in the modal. So if it does not show immediately, the modal won't resize on the user.

djenntt
Автор

It doesn't work when deployed to netlify

chaderenyore
Автор

which theme are you using in Webstorm?

ohiduzzaman_siam
Автор

With Data from API. You can't using with this ??. It only work with image Static image

nguyentrunghau
Автор

is this will effect initial load performance ?

nested
Автор

Can this be replicated with just vue 3 ?

jegedeayodeji