Responsive lazy loading vue component with meduim-style blur effect
npm install vue-lazy-pictureintersection-observer and stackblur-canvas internally.
intersection-observer polyfill separately to support IE and mobile browsers.
// placeholder
`
Usage
Install by npm:
`
npm i vue-lazy-picture
`
Then in your vue app:
`
// App.vue
:src="image.src"
:placeholder="image.ph"
lazy
/>
`
Props
`
containerBgColor: {
type: String,
default: "rgb(222, 222, 222)"
},
maxWidth: {
type: String,
default: "100%"
},
containerClass: {
type: String,
default: "lazy-picture"
},
title: {
type: String,
default: "Image"
},
placeholder: {
type: String,
required: true
},
src: {
type: String,
required: true
},
lazy: {
type: Boolean,
default: false
},
blurRadius: {
type: Number,
default: 5
},
transitionDuration: {
type: Number,
default: 500
},
easing: {
type: String,
default: "ease"
},
threshold: {
type: Number,
default: 0.5
}
``