Skip to content
This repository has been archived by the owner on May 6, 2022. It is now read-only.

LancerComet/vue-lazyimg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Vue-LazyImg

A tiny and stable lazyload plugin for Vue.

For Vue 1.x, please use npm install vue-lazyimg^0.1.0 to install vue-lazyimg.

For Vue 2.x, use npm install vue-lazying.

Introduction.

<body>
  <!-- Load image and set to 'src'. -->
  <img v-lazy="image1">

  <!-- Load image and set to 'background-image'. -->
  <div v-lazy-bg="image2"></div>
</body>
import Vue from 'vue'
import LazyImg from 'vue-lazyimg'

Vue.use(LazyImg) 

const Root = new Vue({
  el: 'body',
  data: {
    image1: 'link-to-my-awesome-background-01.jpg',
    image2: 'link-to-my-awesome-background-02.jpg'
  }
})

License.

© 2016 LancerComet. MIT License.

About

A tiny and stable lazyload plugin for Vue.

Resources

Stars

Watchers

Forks

Packages

No packages published