vue-lazyload-akamai
Vue.js lazy load image directive with akamai image converter
💅 Demo Page
https://bliblidotcom.github.io/vue-lazyload-akamai/
or via forked version here: https://mazipan.github.io/vue-lazyload-akamai/
🛠 Install with NPM/Yarn
npm install vue-lazyload-akamai
// OR
yarn add vue-lazyload-akamai
🚀 Usage Guide
Add plugins in main.js
Vue
✅ Available configs explanations:
Config Name | Type | Description |
---|---|---|
useWebp |
Boolean | Using webp when support |
quality |
Number | Quality of image (using scala from 10-100) |
width & height |
Number | Width and Height of image (in pixel unit) |
fallback |
String | Global fallback image if attr data-err not setted |
placeholder |
String | Global placeholder image if attr src not setted |
timeout |
Number | Timeout before image replaced (in millisecond unit) |
Using in your Vue components:
✅ Attribute explanations:
Attribute Name | Description |
---|---|
src |
Use as placeholder/loading image before original image was loaded. |
data-src |
Original image that we want to load after user scroll to it's sections |
data-err |
Image as fallback when original image failed to load (404 response) |
data-quality |
Quality of image (using scala from 10-100) |
data-width |
Width of image in pixel unit |
data-height |
Height of image in pixel unit |
🗿 Polyfill
https://github.com/w3c/IntersectionObserver/tree/master/polyfill
▶️ Development
// For developmentnpm run dev // For build demo pagenpm run build-demo // For build library filenpm run build-lib // Publish demo pagenpm run publish-demo // Build and publish demonpm run dist
Copyright © 2018 by Blibli.com Tech Team - Released Under MIT License