mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
[new feature] Card: add lazy-load prop (#2301)
This commit is contained in:
parent
fd88a29bfc
commit
a94683a7e3
@ -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 load,should register [Lazyload](#/en-US/lazyload) component | `Boolean` | `false` |
|
||||
|
||||
### Slot
|
||||
|
||||
|
@ -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],
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user