diff --git a/src/coupon-cell/index.js b/src/coupon-cell/index.js index 346a8ef6a..b2daf74ef 100644 --- a/src/coupon-cell/index.js +++ b/src/coupon-cell/index.js @@ -42,9 +42,7 @@ export default createComponent({ setup(props) { return () => { - const valueClass = props.coupons[+props.chosenCoupon] - ? bem('selected') - : ''; + const selected = props.coupons[+props.chosenCoupon]; const value = formatValue(props); return ( @@ -54,7 +52,7 @@ export default createComponent({ title={props.title || t('title')} border={props.border} isLink={props.editable} - valueClass={valueClass} + valueClass={bem('value', { selected })} /> ); }; diff --git a/src/coupon-cell/index.less b/src/coupon-cell/index.less index c7e50c86d..1a2da079e 100644 --- a/src/coupon-cell/index.less +++ b/src/coupon-cell/index.less @@ -1,7 +1,7 @@ @import '../style/var'; .van-coupon-cell { - &--selected { + &__value--selected { color: @coupon-cell-selected-text-color; } } diff --git a/src/coupon-list/test/__snapshots__/demo.spec.js.snap b/src/coupon-list/test/__snapshots__/demo.spec.js.snap index 73c038f70..8c2fdd67d 100644 --- a/src/coupon-list/test/__snapshots__/demo.spec.js.snap +++ b/src/coupon-list/test/__snapshots__/demo.spec.js.snap @@ -5,7 +5,7 @@ exports[`renders demo correctly 1`] = `
优惠券
-
2张可用
+
2张可用
diff --git a/src/coupon-list/test/__snapshots__/index.spec.js.snap b/src/coupon-list/test/__snapshots__/index.spec.js.snap index b6db0680b..1c6330ea1 100644 --- a/src/coupon-list/test/__snapshots__/index.spec.js.snap +++ b/src/coupon-list/test/__snapshots__/index.spec.js.snap @@ -41,7 +41,7 @@ exports[`empty-image prop 1`] = ` exports[`render coupon cell 1`] = `
优惠券
-
暂无可用
+
暂无可用
`; @@ -49,7 +49,7 @@ exports[`render coupon cell 1`] = ` exports[`render coupon cell with coupon 1`] = `
优惠券
-
-¥ 1.00
+
-¥ 1.00
`;