[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>
<cell-group
<cell
:class="b()"
:title="title || $t('title')"
:value="value"
:border="border"
>
<cell
:title="title || $t('title')"
:value="value"
:is-link="editable"
@click="$emit('click')"
/>
</cell-group>
:is-link="editable"
@click="$emit('click')"
/>
</template>
<script>

View File

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

View File

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

View File

@ -3,17 +3,15 @@
exports[`renders demo correctly 1`] = `
<div>
<div>
<div class="van-cell-group van-hairline--top-bottom van-coupon-cell">
<div class="van-cell van-cell--clickable">
<div class="van-cell van-cell--clickable van-coupon-cell">
<!---->
<div class="van-cell__title"><span>优惠券</span>
<!---->
<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" style="color:undefined;font-size:undefined;">
<!---->
</i>
</div>
<div class="van-cell__value"><span>你有 2 个可用优惠</span></div>
<i class="van-icon van-icon-arrow van-cell__right-icon" style="color:undefined;font-size:undefined;">
<!---->
</i>
</div>
<!---->
</div>

View File

@ -1,31 +1,27 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`coupon cell 1`] = `
<div class="van-cell-group van-hairline--top-bottom van-coupon-cell">
<div class="van-cell van-cell--clickable">
<div class="van-cell van-cell--clickable van-coupon-cell">
<!---->
<div class="van-cell__title"><span>优惠券</span>
<!---->
<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">
<!---->
</i>
</div>
<div class="van-cell__value"><span>使用优惠</span></div>
<i class="van-icon van-icon-arrow van-cell__right-icon">
<!---->
</i>
</div>
`;
exports[`coupon cell 2`] = `
<div class="van-cell-group van-hairline--top-bottom van-coupon-cell">
<div class="van-cell van-cell--clickable">
<div class="van-cell van-cell--clickable van-coupon-cell">
<!---->
<div class="van-cell__title"><span>优惠券</span>
<!---->
<div class="van-cell__title"><span>优惠券</span>
<!---->
</div>
<div class="van-cell__value"><span>-¥1.00</span></div>
<i class="van-icon van-icon-arrow van-cell__right-icon">
<!---->
</i>
</div>
<div class="van-cell__value"><span>-¥1.00</span></div>
<i class="van-icon van-icon-arrow van-cell__right-icon">
<!---->
</i>
</div>
`;

View File

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