VUE_v-lazy懒加载

// 安装
npm i vue-lazyload --save

// 注册
import VueLazyload from 'vue-lazyload'  // 引入这个懒加载插件
// Vue.use(VueLazyload) // 直接使用
Vue.use(VueLazyload, { // 添加自定义选项
  preLoad: 1.3,
  error: './assets/images/white.png', // 加载错误时候的图片
  loading: './assets/images/white.png', // 加载中的图片
  attempt: 1,
  listenEvents: [
        'scroll',
        'wheel',
        'mousewheel',
        'resize',
        'animationend',
        'transitionend',
        'touchmove',
    ],
}) 

// 组件使用
<img v-lazy="item.faceImagePath">

版权声明:本文为weixin_44599931原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。