Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yodfz/vue-lazyloadImg
vue插件,延迟载入图片.
https://github.com/yodfz/vue-lazyloadImg
Last synced: 3 months ago
JSON representation
vue插件,延迟载入图片.
- Host: GitHub
- URL: https://github.com/yodfz/vue-lazyloadImg
- Owner: yodfz
- Created: 2016-09-12T03:15:50.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-09-29T11:52:55.000Z (over 8 years ago)
- Last Synced: 2024-10-05T18:17:04.141Z (4 months ago)
- Language: JavaScript
- Size: 32.2 KB
- Stars: 19
- Watchers: 3
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.CN.md
Awesome Lists containing this project
- awesome-github-vue - vue-lazyloadImg - 图片懒加载插件 (实用库)
- awesome-github-vue - vue-lazyloadImg - 图片懒加载插件 (实用库)
- awesome - vue-lazyloadImg - 图片懒加载插件 (实用库)
- awesome-vue - vue-lazyloadImg - lazyloadImg?style=social) - 图片懒加载插件 (实用库)
README
# 如何使用?
![效果展示](http://ww3.sinaimg.cn/large/882a72d0gw1f7qycyxootg20i70hd7wh.gif)
## 安装插件
```javascript
npm install --save vue-lazyloadimg
```## 引用插件
导入插件 `vue-lazyloadimg`.并且使用 vue.use 引用它.
```javascript
import vueLazyImg from 'vue-lazyloadimg';
import vue from 'vue';
vue.use(vueLazyImg);
```## 在模版中如何使用?
在绑定插件之后,插件会读取当前页面上的class标示为`lazyimg`的节点.然后缓存在系统中.
并且在页面节点出现变化的时候会重新缓存 `lazyimg` 节点.
``` html
```# build script
use babel.