vue-lazy-image

a lazy-image module for Vue 1.0+ & 2.0+

MIT License

Downloads
25
Stars
4

lazy-image for Vue

a lazy-image module for Vue 1.0+ & 2.0+

npm package

vue-lazy-image

demo

vue-lazy-image-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