VUE kind of image lazy loading
1. Install the image lazy loading component
npm install vue-lazyload
2. Introduce in main.js
import VueLazyLoad from 'vue-lazyload'
Vue.use(VueLazyLoad,{
error:'./static/error.png', //加载报错图片路径
loading:'./static/loading.gif'//加载中图片路径
})
3. How to use:
将<img :src="路径">
修改成:
<img v-lazy="路径">