🖼️
vue-progressive-image
v4
v4
  • Get started
  • Placeholder image
  • Lazy loading
  • Fallback image
  • Image as background
  • Adjust the blur
  • Events
  • Custom CSS class
  • Delay animation
  • CSS Variables
Powered by GitBook
On this page

Events

PreviousAdjust the blurNextCustom CSS class

Last updated 3 years ago

The component exposes two events: success and error. Pretty straightforward; the first one is triggered when an image is safely loaded and rendered, and the latter will be triggered when the browser fails to load the image. To deal with errors, make sure to check the chapter.

<script setup>
const onSuccess = () => {
  // done!
}

const onError = () => {
  // ops!
}
</script>

<template>
  <ProgressiveImage
    @success="onSuccess"
    @error="onError"
    src="https://picsum.photos/id/1080/1980/1080"
  />
</template>gtnk
fallback image