1.2.1 ā€¢ Published 6 years ago

vue-lazyload-akamai v1.2.1

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

vue-lazyload-akamai

Vue.js lazy load image directive with akamai image converter

License version downloads

šŸ’… 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

import VueLazyloadAkamai from 'vue-lazyload-akamai'
Vue.use(VueLazyloadAkamai, {optionalConfigs})

āœ… Available configs explanations:

Config NameTypeDescription
useWebpBooleanUsing webp when support
qualityNumberQuality of image (using scala from 10-100)
width & heightNumberWidth and Height of image (in pixel unit)
fallbackStringGlobal fallback image if attr data-err not setted
placeholderStringGlobal placeholder image if attr src not setted
timeoutNumberTimeout before image replaced (in millisecond unit)

Using in your Vue components:

<img v-lazyimg
    src="{placeholder image}"
    data-src="{original image}"
    data-err="{fallback image}">

āœ… Attribute explanations:

Attribute NameDescription
srcUse as placeholder/loading image before original image was loaded.
data-srcOriginal image that we want to load after user scroll to it's sections
data-errImage as fallback when original image failed to load (404 response)
data-qualityQuality of image (using scala from 10-100)
data-widthWidth of image in pixel unit
data-heightHeight of image in pixel unit

šŸ—æ Polyfill

https://github.com/w3c/IntersectionObserver/tree/master/polyfill

ā–¶ļø Development

// For development
npm run dev

// For build demo page
npm run build-demo

// For build library file
npm run build-lib

// Publish demo page
npm run publish-demo

// Build and publish demo
npm run dist

Copyright Ā© 2018 by Blibli.com Tech Team - Released Under MIT License