[new feature] Card: add lazy-load prop (#2301)

This commit is contained in:
neverland 2018-12-15 17:55:32 +08:00 committed by GitHub
parent fd88a29bfc
commit a94683a7e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 0 deletions

View File

@ -55,6 +55,7 @@ Use `slot` to custom content.
| centered | Whether content vertical centered | `String` | `false` |
| currency | Currency symbol | `String` | `¥` |
| thumb-link | Thumb link URL | `String` | - |
| lazy-load | Whether to enable thumb lazy loadshould register [Lazyload](#/en-US/lazyload) component | `Boolean` | `false` |
### Slot

View File

@ -6,6 +6,12 @@
>
<slot name="thumb">
<img
v-if="lazyLoad"
v-lazy="thumb"
:class="b('img')"
>
<img
v-else
:src="thumb"
:class="b('img')"
>
@ -81,6 +87,7 @@ export default create({
thumb: String,
title: String,
centered: Boolean,
lazyLoad: Boolean,
thumbLink: String,
num: [Number, String],
price: [Number, String],

View File

@ -55,6 +55,7 @@ Vue.use(Card);
| centered | 内容是否垂直居中 | `String` | `false` | - |
| currency | 货币符号 | `String` | `¥` | - |
| thumb-link | 点击左侧图片后的跳转链接 | `String` | - | 1.3.4 |
| lazy-load | 是否开启图片懒加载,须配合 [Lazyload](#/zh-CN/lazyload) 组件使用 | `Boolean` | `false` | 1.5.0 |
### Slot