a lazy-image module for Vue 1.0+ & 2.0+
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>
npm run build