[improvement] CouponCell: remove wrapper (#2145)

This commit is contained in:
neverland 2018-11-26 16:47:44 +08:00 committed by GitHub
parent 0ffaa7bf3d
commit b567a2a563
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 30 additions and 39 deletions

View File

@ -1,15 +1,12 @@
<template> <template>
<cell-group
:class="b()"
:border="border"
>
<cell <cell
:class="b()"
:title="title || $t('title')" :title="title || $t('title')"
:value="value" :value="value"
:border="border"
:is-link="editable" :is-link="editable"
@click="$emit('click')" @click="$emit('click')"
/> />
</cell-group>
</template> </template>
<script> <script>

View File

@ -10,8 +10,8 @@
<p>{{ validPeriod }}</p> <p>{{ validPeriod }}</p>
<checkbox <checkbox
v-if="chosen" v-if="chosen"
:value="true"
:class="b('corner')" :class="b('corner')"
value
/> />
</div> </div>
</div> </div>

View File

@ -73,7 +73,7 @@ export default {
| chosen-coupon | Index of chosen coupon | `Number` | `-1` | | chosen-coupon | Index of chosen coupon | `Number` | `-1` |
| coupons | Coupon list | `Array` | `[]` | | coupons | Coupon list | `Array` | `[]` |
| editable | Cell editable | `Boolean` | `true` | | editable | Cell editable | `Boolean` | `true` |
| border | Whether to show outer border | `Boolean` | `true` | | border | Whether to show innner border | `Boolean` | `true` |
### CouponList API ### CouponList API

View File

@ -3,8 +3,7 @@
exports[`renders demo correctly 1`] = ` exports[`renders demo correctly 1`] = `
<div> <div>
<div> <div>
<div class="van-cell-group van-hairline--top-bottom van-coupon-cell"> <div class="van-cell van-cell--clickable van-coupon-cell">
<div class="van-cell van-cell--clickable">
<!----> <!---->
<div class="van-cell__title"><span>优惠券</span> <div class="van-cell__title"><span>优惠券</span>
<!----> <!---->
@ -14,7 +13,6 @@ exports[`renders demo correctly 1`] = `
<!----> <!---->
</i> </i>
</div> </div>
</div>
<!----> <!---->
</div> </div>
</div> </div>

View File

@ -1,8 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`coupon cell 1`] = ` exports[`coupon cell 1`] = `
<div class="van-cell-group van-hairline--top-bottom van-coupon-cell"> <div class="van-cell van-cell--clickable van-coupon-cell">
<div class="van-cell van-cell--clickable">
<!----> <!---->
<div class="van-cell__title"><span>优惠券</span> <div class="van-cell__title"><span>优惠券</span>
<!----> <!---->
@ -12,12 +11,10 @@ exports[`coupon cell 1`] = `
<!----> <!---->
</i> </i>
</div> </div>
</div>
`; `;
exports[`coupon cell 2`] = ` exports[`coupon cell 2`] = `
<div class="van-cell-group van-hairline--top-bottom van-coupon-cell"> <div class="van-cell van-cell--clickable van-coupon-cell">
<div class="van-cell van-cell--clickable">
<!----> <!---->
<div class="van-cell__title"><span>优惠券</span> <div class="van-cell__title"><span>优惠券</span>
<!----> <!---->
@ -27,5 +24,4 @@ exports[`coupon cell 2`] = `
<!----> <!---->
</i> </i>
</div> </div>
</div>
`; `;

View File

@ -74,7 +74,7 @@ export default {
| chosen-coupon | 当前选中优惠券的索引 | `Number` | `-1` | - | | chosen-coupon | 当前选中优惠券的索引 | `Number` | `-1` | - |
| coupons | 可用优惠券列表 | `Array` | `[]` | - | | coupons | 可用优惠券列表 | `Array` | `[]` | - |
| editable | 能否切换优惠券 | `Boolean` | `true` | - | | editable | 能否切换优惠券 | `Boolean` | `true` | - |
| border | 是否显示边框 | `Boolean` | `true` | 1.3.10 | | border | 是否显示边框 | `Boolean` | `true` | 1.3.10 |
### CouponList API ### CouponList API