Merge branch 'dev' into next

This commit is contained in:
chenjiahan 2020-08-17 22:39:24 +08:00
commit ee4464b6b0
4 changed files with 6 additions and 8 deletions

View File

@ -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 })}
/>
);
};

View File

@ -1,7 +1,7 @@
@import '../style/var';
.van-coupon-cell {
&--selected {
&__value--selected {
color: @coupon-cell-selected-text-color;
}
}

View File

@ -5,7 +5,7 @@ exports[`renders demo correctly 1`] = `
<div>
<div role="button" tabindex="0" class="van-cell van-cell--clickable van-coupon-cell">
<div class="van-cell__title"><span>优惠券</span></div>
<div class="van-cell__value"><span>2张可用</span></div><i class="van-icon van-icon-arrow van-cell__right-icon">
<div class="van-cell__value van-coupon-cell__value"><span>2张可用</span></div><i class="van-icon van-icon-arrow van-cell__right-icon">
<!----></i>
</div>
<!---->

View File

@ -41,7 +41,7 @@ exports[`empty-image prop 1`] = `
exports[`render coupon cell 1`] = `
<div role="button" tabindex="0" class="van-cell van-cell--clickable van-coupon-cell">
<div class="van-cell__title"><span>优惠券</span></div>
<div class="van-cell__value"><span>暂无可用</span></div><i class="van-icon van-icon-arrow van-cell__right-icon">
<div class="van-cell__value van-coupon-cell__value"><span>暂无可用</span></div><i class="van-icon van-icon-arrow van-cell__right-icon">
<!----></i>
</div>
`;
@ -49,7 +49,7 @@ exports[`render coupon cell 1`] = `
exports[`render coupon cell with coupon 1`] = `
<div role="button" tabindex="0" class="van-cell van-cell--clickable van-coupon-cell">
<div class="van-cell__title"><span>优惠券</span></div>
<div class="van-cell__value van-coupon-cell--selected"><span>-¥ 1.00</span></div><i class="van-icon van-icon-arrow van-cell__right-icon">
<div class="van-cell__value van-coupon-cell__value van-coupon-cell__value--selected"><span>-¥ 1.00</span></div><i class="van-icon van-icon-arrow van-cell__right-icon">
<!----></i>
</div>
`;