BKWLD / vue-visual

Vue 2 image and video loader supporting lazy loading, background videos, fixed aspect ratios, low rez poster images, transitions, loaders, slotted content and more.
https://bkwld.github.io/vue-visual
MIT License
59 stars 7 forks source link

Add `preload` prop which renders a preload `<link>` tag #74

Closed weotch closed 11 months ago

weotch commented 1 year ago

This would be similar to what nuxt/image does here:

https://github.com/nuxt/image/blob/3ec797a55ab99425b55a1247632bc2cac0f662d5/src/runtime/components/nuxt-img.vue#L25-L38

Where it gets a bit more complicated is supporting Visual's srcset and sizes props. Here's how nuxt/image does that:

https://github.com/nuxt/image/blob/3ec797a55ab99425b55a1247632bc2cac0f662d5/src/runtime/components/nuxt-picture.vue#L34-L50