docs: prettier all markdown files
This commit is contained in:
+17
-17
@@ -10,7 +10,7 @@ Vue.use(Lazyload);
|
||||
|
||||
// with options
|
||||
Vue.use(Lazyload, {
|
||||
lazyComponent: true
|
||||
lazyComponent: true,
|
||||
});
|
||||
```
|
||||
|
||||
@@ -19,7 +19,7 @@ Vue.use(Lazyload, {
|
||||
### Basic Usage
|
||||
|
||||
```html
|
||||
<img v-for="img in imageList" v-lazy="img" >
|
||||
<img v-for="img in imageList" v-lazy="img" />
|
||||
```
|
||||
|
||||
```js
|
||||
@@ -28,11 +28,11 @@ export default {
|
||||
return {
|
||||
imageList: [
|
||||
'https://img.yzcdn.cn/vant/apple-1.jpg',
|
||||
'https://img.yzcdn.cn/vant/apple-2.jpg'
|
||||
]
|
||||
'https://img.yzcdn.cn/vant/apple-2.jpg',
|
||||
],
|
||||
};
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
### Lazyload Background Image
|
||||
@@ -48,13 +48,13 @@ Use `v-lazy:background-image` to set background url, and declare the height of t
|
||||
```js
|
||||
// set `lazyComponent` option
|
||||
Vue.use(Lazyload, {
|
||||
lazyComponent: true
|
||||
lazyComponent: true,
|
||||
});
|
||||
```
|
||||
|
||||
```html
|
||||
<lazy-component>
|
||||
<img v-for="img in imageList" v-lazy="img" >
|
||||
<img v-for="img in imageList" v-lazy="img" />
|
||||
</lazy-component>
|
||||
```
|
||||
|
||||
@@ -63,14 +63,14 @@ Vue.use(Lazyload, {
|
||||
### Options
|
||||
|
||||
| Attribute | Description | Type | Default |
|
||||
|------|------|------|------|
|
||||
| loading | Src of the image while loading | *string* | - |
|
||||
| error | Src of the image upon load fail | *string* | - |
|
||||
| preload | Proportion of pre-loading height | *string* | - |
|
||||
| attempt | Attempts count | *number* | `3` |
|
||||
| listenEvents | Events that you want vue listen for | *string[]* | `scroll`... |
|
||||
| adapter | Dynamically modify the attribute of element | *object* | - |
|
||||
| filter | The image's listener filter | *object* | - |
|
||||
| lazyComponent | Lazyload component | *boolean* | `false` |
|
||||
| --- | --- | --- | --- |
|
||||
| loading | Src of the image while loading | _string_ | - |
|
||||
| error | Src of the image upon load fail | _string_ | - |
|
||||
| preload | Proportion of pre-loading height | _string_ | - |
|
||||
| attempt | Attempts count | _number_ | `3` |
|
||||
| listenEvents | Events that you want vue listen for | _string[]_ | `scroll`... |
|
||||
| adapter | Dynamically modify the attribute of element | _object_ | - |
|
||||
| filter | The image's listener filter | _object_ | - |
|
||||
| lazyComponent | Lazyload component | _boolean_ | `false` |
|
||||
|
||||
> See more:[ vue-lazyload ](https://github.com/hilongjw/vue-lazyload)
|
||||
|
||||
@@ -12,7 +12,7 @@ Vue.use(Lazyload);
|
||||
|
||||
// 注册时可以配置额外的选项
|
||||
Vue.use(Lazyload, {
|
||||
lazyComponent: true
|
||||
lazyComponent: true,
|
||||
});
|
||||
```
|
||||
|
||||
@@ -23,7 +23,7 @@ Vue.use(Lazyload, {
|
||||
将`v-lazy`指令的值设置为你需要懒加载的图片
|
||||
|
||||
```html
|
||||
<img v-for="img in imageList" v-lazy="img" >
|
||||
<img v-for="img in imageList" v-lazy="img" />
|
||||
```
|
||||
|
||||
```js
|
||||
@@ -32,11 +32,11 @@ export default {
|
||||
return {
|
||||
imageList: [
|
||||
'https://img.yzcdn.cn/vant/apple-1.jpg',
|
||||
'https://img.yzcdn.cn/vant/apple-2.jpg'
|
||||
]
|
||||
'https://img.yzcdn.cn/vant/apple-2.jpg',
|
||||
],
|
||||
};
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
### 背景图懒加载
|
||||
@@ -54,13 +54,13 @@ export default {
|
||||
```js
|
||||
// 注册时设置`lazyComponent`选项
|
||||
Vue.use(Lazyload, {
|
||||
lazyComponent: true
|
||||
lazyComponent: true,
|
||||
});
|
||||
```
|
||||
|
||||
```html
|
||||
<lazy-component>
|
||||
<img v-for="img in imageList" v-lazy="img" >
|
||||
<img v-for="img in imageList" v-lazy="img" />
|
||||
</lazy-component>
|
||||
```
|
||||
|
||||
@@ -68,15 +68,15 @@ Vue.use(Lazyload, {
|
||||
|
||||
### Options
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|------|------|------|------|
|
||||
| loading | 加载时的图片 | *string* | - |
|
||||
| error | 错误时的图片 | *string* | - |
|
||||
| preload | 预加载高度的比例 | *string* | - |
|
||||
| attempt | 尝试次数 | *number* | `3` |
|
||||
| listenEvents | 监听的事件 | *string[]* | `scroll`等 |
|
||||
| adapter | 适配器 | *object* | - |
|
||||
| filter | 图片 URL 过滤 | *object* | - |
|
||||
| lazyComponent | 是否能懒加载模块 | *boolean* | `false` |
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
| ------------- | ---------------- | ---------- | ---------- |
|
||||
| loading | 加载时的图片 | _string_ | - |
|
||||
| error | 错误时的图片 | _string_ | - |
|
||||
| preload | 预加载高度的比例 | _string_ | - |
|
||||
| attempt | 尝试次数 | _number_ | `3` |
|
||||
| listenEvents | 监听的事件 | _string[]_ | `scroll`等 |
|
||||
| adapter | 适配器 | _object_ | - |
|
||||
| filter | 图片 URL 过滤 | _object_ | - |
|
||||
| lazyComponent | 是否能懒加载模块 | _boolean_ | `false` |
|
||||
|
||||
> 更多内容请参照:[vue-lazyload 官方文档](https://github.com/hilongjw/vue-lazyload)
|
||||
|
||||
Reference in New Issue
Block a user