1.2.0 • Published 7 years ago
vue-lazy-image v1.2.0
lazy-image for Vue
a lazy-image module for Vue 1.0+ & 2.0+
npm package
demo
usage
const lazy = require('vue-lazy-image')
// or use ES2015
//import lazy from 'vue-lazy-image'
Vue.use(lazy);
// or with options
Vue.use(lazy, {
error: 'http://xxx.com/error.png', //error image
loading: 'http://xxx.com/loading.png', //loading image
try: 2, // the count of try to load one image
});
<img v-lazy="item.image">
<div class="img" v-lazy:background-image="item.image"></div>
build
npm run build