Skip to content

lzxb/vue-lazy-load-img

Repository files navigation

关于

本插件基于lazy-load-img的vue版本实现,请到lazy-load-img查看文档

开发

npm install 
npm run dev

使用

  • 支持模块化加载和浏览器中直接引入使用
  • npm install --save-dev lazy-load-img vue-lazy-load-img
import Vue from 'vue'
import VueLazyLoadImg from 'vue-lazy-load-img'

Vue.use(VueLazyLoadImg)
<vue-lazy-load-img 
    mode="diy"
    :time="300"
    :done="true"
    :position="{ top: 0, right: 0, bottom: 0, left: 0 }"
    :diy="{ backgroundSize: 'cover', backgroundRepeat: 'no-repeat', backgroundPosition: 'center center' }"
    @before="before" 
    @success="success" 
    @error="error">
    <img src="./images/default.png" data-src="./images/test.png" alt="">
</vue-lazy-load-img>

Releases

No releases published

Packages

No packages published