samjonesigd / vue-image-zoomer

Image zoom component for Vue.js
https://samueljon.es/vue-image-zoomer
MIT License
103 stars 10 forks source link

Add "loaded" event #13

Closed fernao closed 1 year ago

fernao commented 1 year ago

It would be wonderful if this component had an "loaded" event, in order to communicate with other components and trigger actions.

samjonesigd commented 1 year ago

@fernao Just when the component is loaded or the image in the component has loaded?

Will work on it

fernao commented 1 year ago

When images are loaded (considering "regular" and "zoom" sources). I don't know if from both, but the first is good because it can help user to handle the moment that images are loading.

Another option is like vuetify on it's v-img It has a "lazy-src", a image that could be at low resolution that is placed while the regular is not loaded.

samjonesigd commented 1 year ago

It used to have a placeholder image but this required javascript lazyloading when it now uses native loading attribute.

I will add lots of events for the parent to be able to look at :) including what you're wanting

samjonesigd commented 1 year ago

@fernao added some events and ability to add a slot as a placeholder before load, also done this one the Vue 2 legacy.

On NPM: v2.2.0 for Vue 3 v1.5.0 for Legacy Vue 2