neverland c8915d3984
[Bugfix] delete unnecessary coupon desc (#360)
* fix: Tabbar icon line-height

* [new feature] progress add showPivot prop

* [new feature] TabItem support vue-router

* [new feature] update document header style

* [Doc] add toast english ducoment

* [bugfix] Search box-sizing wrong

* [Doc] update vant-demo respo

* [Doc] translate theme & demo pages

* [Doc] add Internationalization document

* [bugfix] remove unnecessary props

* [fix] optimize clickoutside

* [new feature] optimize find-parent

* [new feature]: change document title accordinng to language

* [new feature] Pagination code review

* [improvement] adjust icon-font unicode

* [improvement] Icon spinner color inherit

* [improvement] icon default width

* [bugfix] DateTimePicker validate date props

* [bugfix] Tab item text ellipsis

* [improvement] optimize single line ellipsis

* [Improvement] optimzie staticClass

* [Improvement] Button: use sfc instread of jsx

* [Improvement] update actionsheet close icon style

* fix: yarn.lock

* fix: icon test cases

* [bugfix] errors during ssr

* [Improvement] SubmitBar add left slot

* [new feature] ImagePreview support manually close

* fix: ImagePreview test case

* [Doc] add switch lang button in mobile

* [bugfix] Popup overlay style update

* [bugfix] NavBar click event

* [Improvement] optimize build speed

* [new feature] CellSwipe support async controll

* [new feature] Uploader support inherit attrs

* [Bugfix] delete unnecessary coupon desc

* fix: coupon test case
2017-11-29 16:32:44 +08:00

57 lines
1.1 KiB
Vue

<template>
<div class="van-coupon-cell">
<van-cell-group>
<van-cell :title="title" :isLink="editable" @click="$emit('click')">
<div v-if="coupons[chosenCoupon]">
<div>{{ coupons[chosenCoupon].name }}</div>
<div>{{ coupons[chosenCoupon].condition }}</div>
</div>
<template v-else>{{ guide }}</template>
</van-cell>
</van-cell-group>
</div>
</template>
<script>
import Cell from '../cell';
import CellGroup from '../cell-group';
export default {
name: 'van-coupon-cell',
components: {
[Cell.name]: Cell,
[CellGroup.name]: CellGroup
},
model: {
prop: 'chosenCoupon'
},
props: {
title: {
type: String,
default: '优惠'
},
coupons: {
type: Array,
default: () => []
},
chosenCoupon: {
type: Number,
default: -1
},
editable: {
type: Boolean,
default: true
}
},
computed: {
guide() {
return this.coupons.length === 0 ? '使用优惠' : `您有 ${this.coupons.length} 个可用优惠`;
}
}
};
</script>