0.0.4 • Published 4 years ago

vue-lazyload-images v0.0.4

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

Installation

npm

$ npm i vue-lazyload-images -S

Usage

main.js:

import Vue from 'vue'
import App from './App.vue'
import VueImgLazyload from 'vue-lazyload-images'

Vue.directive('imglazyload', VueImgLazyload)

new Vue({
  el: '#app',
  render: h => h(App)
})

template:

<ul v-imglazyload>
  <li v-for="item in list">
    <img :data-src="item.imgUrl" class="lazy">
  </li>
</ul>

use background-image

<ul v-imglazyload>
  <li v-for="item in list">
    <div :data-bg="item.imgUrl" class="lazy"></div>
  </li>
</ul>

License

The MIT License

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago