LazyLoad 图片懒加载
使用指南
import Vue from 'vue'
import { LazyLoad } from 'fs-ui'
Vue.use(LazyLoad, {
lazyComponent: true
})
1
2
3
4
5
6
2
3
4
5
6
代码演示
- 普通
<img v-for="(img, index) in imgList" v-lazy="img" :key="index">
1
- 背景图懒加载
<div v-for="(img, index) in backgroundImageList" v-lazy:background-image="img" :key="index" />
1
- 懒加载模块
<lazy-component>
<img v-for="(img, index) in componentImageList" v-lazy="img" :key="index" >
</lazy-component>
1
2
3
2
3
详细文档参考 https://github.com/hilongjw/vue-lazyload