Skip to content

Commit

Permalink
fix(nuxt): emit loaded event for preloaded images
Browse files Browse the repository at this point in the history
  • Loading branch information
johannschopplich committed Apr 4, 2024
1 parent 6a0bf2a commit fc30131
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/nuxt/src/runtime/components/UnLazyImage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ watchEffect(() => {
if (props.autoSizes)
_autoSizes(target.value)
loadImage(target.value)
emit('loaded', target.value)
return
}
Expand All @@ -120,7 +121,9 @@ watchEffect(() => {
// Placeholder is already decoded
cleanup = lazyLoad(target.value, {
hash: false,
onImageLoad: image => emit('loaded', image),
onImageLoad(image) {
emit('loaded', image)
},
})
})
Expand Down

0 comments on commit fc30131

Please sign in to comment.