简介:Vue module for lazyloading images in your applications. Some of goals of this project worth noting include:

  • Be lightweight, powerful and easy to use
  • Work on any image type
  • Add loading class while image is loading
  • Supports both of Vue 1.0 and Vue 2.0

GitHub地址

  1. 安装

    1
    npm i vue-lazyload --save
  2. 导入(main.js)

    1
    import VueLazyLoad from 'vue-lazyload'
  3. 使用(相关配置项可以到官网查看)

    1
    2
    3
    4
    //图片懒加载
    Vue.use(VueLazyLoad, {
    loading: require('./assets/img/common/placeholder.png')
    })