- base on Vue 2.0
- support umd
- 1kb
View by phone mode in chrome:
https://gavin-yyc.github.io/vue-lazyload/demo/index.html
or scan:
// assume you already use the Vue
// first
<script src="../build/lazyload.min.js" charset="utf-8"></script>
// then install directive
Vue.use( lazyload, {
defaultPic: './img/default.png'
});
// last use case
// image
<img v-lazy="item.imgurl">
// background
<div v-lazy.background="item.imgurl"></div>
npm run build
npm run dev