vue-load-image
vue-load-image is 3KB minimalist Vue component that display loader during image loading, as well as by display alternate content when the image fails to load.
Getting started
npm install vue-load-image --save
Usage
img
background-image
Notice
set data-src to be the same as background-image url
Events
Name | Description |
---|---|
onError |
onError gets triggered when image fails to load. |
onLoad |
onLoad gets triggered when image is loaded. |
Slots
"image" slot will be rendered when the image is successfully loaded
"preloader" slot will be rendered when the image is in the process of loading
"error" slot will be rendered when the image load fails.