mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix(CouponCell): incorrect value class
This commit is contained in:
parent
fc8009b6bf
commit
980f472259
@ -1,7 +1,7 @@
|
|||||||
@import '../style/var';
|
@import '../style/var';
|
||||||
|
|
||||||
.van-coupon-cell {
|
.van-coupon-cell {
|
||||||
&--selected {
|
&__value--selected {
|
||||||
color: @coupon-cell-selected-text-color;
|
color: @coupon-cell-selected-text-color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,7 @@ function CouponCell(
|
|||||||
slots: DefaultSlots,
|
slots: DefaultSlots,
|
||||||
ctx: RenderContext<CouponCellProps>
|
ctx: RenderContext<CouponCellProps>
|
||||||
) {
|
) {
|
||||||
const valueClass = props.coupons[+props.chosenCoupon] ? bem('selected') : '';
|
const selected = props.coupons[+props.chosenCoupon];
|
||||||
const value = formatValue(props);
|
const value = formatValue(props);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -49,7 +49,7 @@ function CouponCell(
|
|||||||
title={props.title || t('title')}
|
title={props.title || t('title')}
|
||||||
border={props.border}
|
border={props.border}
|
||||||
isLink={props.editable}
|
isLink={props.editable}
|
||||||
valueClass={valueClass}
|
valueClass={bem('value', { selected })}
|
||||||
{...inherit(ctx, true)}
|
{...inherit(ctx, true)}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
@ -5,7 +5,7 @@ exports[`renders demo correctly 1`] = `
|
|||||||
<div>
|
<div>
|
||||||
<div role="button" tabindex="0" class="van-cell van-cell--clickable van-coupon-cell">
|
<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__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>
|
<!----></i>
|
||||||
</div>
|
</div>
|
||||||
<!---->
|
<!---->
|
||||||
|
@ -41,7 +41,7 @@ exports[`empty-image prop 1`] = `
|
|||||||
exports[`render coupon cell 1`] = `
|
exports[`render coupon cell 1`] = `
|
||||||
<div role="button" tabindex="0" class="van-cell van-cell--clickable van-coupon-cell">
|
<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__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>
|
<!----></i>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
@ -49,7 +49,7 @@ exports[`render coupon cell 1`] = `
|
|||||||
exports[`render coupon cell with coupon 1`] = `
|
exports[`render coupon cell with coupon 1`] = `
|
||||||
<div role="button" tabindex="0" class="van-cell van-cell--clickable van-coupon-cell">
|
<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__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>
|
<!----></i>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user