From ad25616b059895481c3ad6a82c94c0776a5717cf Mon Sep 17 00:00:00 2001 From: rex Date: Mon, 18 Mar 2019 19:31:14 +0800 Subject: [PATCH] [bugfix] Coupon: show undefined without unitDesc @rex-zsd (#2991) --- packages/coupon/index.js | 2 +- packages/coupon/index.less | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/coupon/index.js b/packages/coupon/index.js index 00cdb76d4..99bd948fa 100644 --- a/packages/coupon/index.js +++ b/packages/coupon/index.js @@ -39,7 +39,7 @@ export default sfc({ faceAmount() { const { coupon } = this; if (coupon.valueDesc) { - return `${coupon.valueDesc}${coupon.unitDesc}`; + return `${coupon.valueDesc}${coupon.unitDesc || ''}`; } return coupon.denominations ? `${this.currency} ${formatAmount(this.coupon.denominations)}` diff --git a/packages/coupon/index.less b/packages/coupon/index.less index 817f68206..1c67bfaf5 100644 --- a/packages/coupon/index.less +++ b/packages/coupon/index.less @@ -48,7 +48,10 @@ font-size: 24px; span { - margin-left: 2px; + &:not(:empty) { + margin-left: 2px; + } + font-size: 50%; } }