mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
[Improvement] SubmitBar: support custom currency symbol (#876)
This commit is contained in:
parent
62f03ac00d
commit
2ce0803ffe
@ -49,6 +49,7 @@ Use `slot` to custom content.
|
|||||||
| num | Number of goods | `String | Number` | - | - |
|
| num | Number of goods | `String | Number` | - | - |
|
||||||
| price | Price of goods | `String | Number` | - | - |
|
| price | Price of goods | `String | Number` | - | - |
|
||||||
| centered | Whether content vertical centered | `String` | `false` | - |
|
| centered | Whether content vertical centered | `String` | `false` | - |
|
||||||
|
| currency | Currency symbol | `String` | `¥` | - |
|
||||||
|
|
||||||
### Slot
|
### Slot
|
||||||
|
|
||||||
|
@ -71,6 +71,7 @@ Use slot to add custom contents.
|
|||||||
| tip | Tip | `String` | - | - |
|
| tip | Tip | `String` | - | - |
|
||||||
| disabled | Whether to disable button | `Boolean` | `false` | - |
|
| disabled | Whether to disable button | `Boolean` | `false` | - |
|
||||||
| loading | Whether to show loading icon | `Boolean` | `false` | - |
|
| loading | Whether to show loading icon | `Boolean` | `false` | - |
|
||||||
|
| currency | Currency symbol | `String` | `¥` | - |
|
||||||
|
|
||||||
### Event
|
### Event
|
||||||
|
|
||||||
|
@ -49,6 +49,7 @@ Vue.use(Card);
|
|||||||
| num | 商品数量 | `String | Number` | - | - |
|
| num | 商品数量 | `String | Number` | - | - |
|
||||||
| price | 商品价格 | `String | Number` | - | - |
|
| price | 商品价格 | `String | Number` | - | - |
|
||||||
| centered | 内容是否垂直居中 | `String` | `false` | - |
|
| centered | 内容是否垂直居中 | `String` | `false` | - |
|
||||||
|
| currency | 货币符号 | `String` | `¥` | - |
|
||||||
|
|
||||||
### Slot
|
### Slot
|
||||||
|
|
||||||
|
@ -71,6 +71,7 @@ Vue.use(SubmitBar);
|
|||||||
| tip | 提示文案 | `String` | - | - |
|
| tip | 提示文案 | `String` | - | - |
|
||||||
| disabled | 是否禁用按钮 | `Boolean` | `false` | - |
|
| disabled | 是否禁用按钮 | `Boolean` | `false` | - |
|
||||||
| loading | 是否显示加载中的按钮 | `Boolean` | `false` | - |
|
| loading | 是否显示加载中的按钮 | `Boolean` | `false` | - |
|
||||||
|
| currency | 货币符号 | `String` | `¥` | - |
|
||||||
|
|
||||||
### Event
|
### Event
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
<slot name="title">
|
<slot name="title">
|
||||||
<div class="van-card__row" v-if="title || price !== undefined">
|
<div class="van-card__row" v-if="title || price !== undefined">
|
||||||
<div v-if="title" class="van-card__title">{{ title }}</div>
|
<div v-if="title" class="van-card__title">{{ title }}</div>
|
||||||
<div v-if="price !== undefined" class="van-card__price">¥ {{ price }}</div>
|
<div v-if="price !== undefined" class="van-card__price">{{ currency }} {{ price }}</div>
|
||||||
</div>
|
</div>
|
||||||
</slot>
|
</slot>
|
||||||
<slot name="desc">
|
<slot name="desc">
|
||||||
@ -38,7 +38,11 @@ export default create({
|
|||||||
desc: String,
|
desc: String,
|
||||||
centered: Boolean,
|
centered: Boolean,
|
||||||
num: [Number, String],
|
num: [Number, String],
|
||||||
price: [Number, String]
|
price: [Number, String],
|
||||||
|
currency: {
|
||||||
|
type: String,
|
||||||
|
default: '¥'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
<div class="van-submit-bar__price">
|
<div class="van-submit-bar__price">
|
||||||
<template v-if="hasPrice">
|
<template v-if="hasPrice">
|
||||||
<span>{{ label || $t('label') }}</span>
|
<span>{{ label || $t('label') }}</span>
|
||||||
<span class="van-submit-bar__price-interger">¥{{ priceInterger }}.</span>
|
<span class="van-submit-bar__price-interger">{{ currency }}{{ priceInterger }}.</span>
|
||||||
<span class="van-submit-bar__price-decimal">{{ priceDecimal }}</span>
|
<span class="van-submit-bar__price-decimal">{{ priceDecimal }}</span>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
@ -38,6 +38,10 @@ export default create({
|
|||||||
loading: Boolean,
|
loading: Boolean,
|
||||||
disabled: Boolean,
|
disabled: Boolean,
|
||||||
buttonText: String,
|
buttonText: String,
|
||||||
|
currency: {
|
||||||
|
type: String,
|
||||||
|
default: '¥'
|
||||||
|
},
|
||||||
buttonType: {
|
buttonType: {
|
||||||
type: String,
|
type: String,
|
||||||
default: 'danger'
|
default: 'danger'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user