[new feature] Coupon: add currency prop (#2274)
This commit is contained in:
@@ -22,6 +22,10 @@ export default create({
|
||||
props: {
|
||||
title: String,
|
||||
coupons: Array,
|
||||
currency: {
|
||||
type: String,
|
||||
default: '¥'
|
||||
},
|
||||
border: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
@@ -42,7 +46,7 @@ export default create({
|
||||
const coupon = coupons[this.chosenCoupon];
|
||||
if (coupon) {
|
||||
const value = coupon.denominations || coupon.value;
|
||||
return `-¥${(value / 100).toFixed(2)}`;
|
||||
return `-${this.currency}${(value / 100).toFixed(2)}`;
|
||||
}
|
||||
return coupons.length === 0 ? this.$t('tips') : this.$t('count', coupons.length);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user