mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
[new feature] Card: add price、num slot (#2416)
This commit is contained in:
parent
b4788f7b43
commit
e078bc9095
@ -63,6 +63,8 @@ Use `slot` to custom content.
|
||||
|------|------|
|
||||
| title | Custom title |
|
||||
| desc | Custom description |
|
||||
| tags | Custom tags |
|
||||
| num | Custom num |
|
||||
| price | Custom price |
|
||||
| thumb | Custom thumb |
|
||||
| tags | Custom tags |
|
||||
| footer | Custom footer |
|
||||
|
@ -49,7 +49,7 @@
|
||||
v-if="isDef(price)"
|
||||
:class="b('price')"
|
||||
>
|
||||
{{ currency }} {{ price }}
|
||||
<slot name="price">{{ currency }} {{ price }}</slot>
|
||||
</div>
|
||||
<div
|
||||
v-if="isDef(originPrice)"
|
||||
@ -58,10 +58,10 @@
|
||||
{{ currency }} {{ originPrice }}
|
||||
</div>
|
||||
<div
|
||||
v-if="isDef(num)"
|
||||
v-if="isDef(num) || $slots.num"
|
||||
:class="b('num')"
|
||||
>
|
||||
x {{ num }}
|
||||
<slot name="num">x {{ num }}</slot>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -9,13 +9,9 @@ exports[`renders demo correctly 1`] = `
|
||||
<div class="van-card__title">2018秋冬新款男士休闲时尚军绿飞行夹克秋冬新款男</div>
|
||||
<div class="van-card__desc van-ellipsis">描述信息</div>
|
||||
<div class="van-card__bottom">
|
||||
<div class="van-card__price">
|
||||
¥ 2.00
|
||||
</div>
|
||||
<div class="van-card__price">¥ 2.00</div>
|
||||
<!---->
|
||||
<div class="van-card__num">
|
||||
x 2
|
||||
</div>
|
||||
<div class="van-card__num">x 2</div>
|
||||
</div>
|
||||
</div>
|
||||
<!---->
|
||||
@ -34,15 +30,11 @@ exports[`renders demo correctly 1`] = `
|
||||
标签2
|
||||
</span></div>
|
||||
<div class="van-card__bottom">
|
||||
<div class="van-card__price">
|
||||
¥ 2.00
|
||||
</div>
|
||||
<div class="van-card__price">¥ 2.00</div>
|
||||
<div class="van-card__origin-price">
|
||||
¥ 10.00
|
||||
</div>
|
||||
<div class="van-card__num">
|
||||
x 2
|
||||
</div>
|
||||
<div class="van-card__num">x 2</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="van-card__footer">
|
||||
|
@ -63,6 +63,8 @@ Vue.use(Card);
|
||||
|------|------|
|
||||
| title | 自定义标题 |
|
||||
| desc | 自定义描述 |
|
||||
| tags | 自定义描述下方的内容 |
|
||||
| num | 自定义数量 |
|
||||
| price | 自定义价格 |
|
||||
| thumb | 自定义图片 |
|
||||
| tags | 自定义描述下方的内容 |
|
||||
| footer | 自定义右下角内容 |
|
||||
|
Loading…
x
Reference in New Issue
Block a user