Skip to content

a lightful image lazyload plugin for Vue. 指令风格的轻量级滚动懒加载插件

License

Notifications You must be signed in to change notification settings

BetaSu/vue-image-lazyload

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vue-image-lazyload

A lightful image lazyload plugin for Vue.

Vue的轻量级滚动懒加载插件

  • You can simply add v-lazy-container to a element,and img contains in this element which has v-lazy-src would load until it's in the visible area of the element,this plugin is not only work for father-son relationship but also any tree structure.
  • To become a lazyload img,use 'v-lazy-src' instead of 'src'
  • 为一个元素加上‘v-lazy-container’指令,该元素内部(不止是父子关系)所有加了‘v-lazy-src’指令的img标签将会在滚动到元素的可视区域后再加载
  • 为需要懒加载的img标签添加'v-lazy-src'而不是'src'

Install

npm install vue-lazy-imgs

Usage

import lazyload from 'vue-lazy-imgs'
Vue.use(lazyload)
<div v-lazy-container>
  <img v-lazy-src='http://xxx.xxx.xxx'>
</div>

About

a lightful image lazyload plugin for Vue. 指令风格的轻量级滚动懒加载插件

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages