[bugfix] Dialog should reset button text when showed (#278)

* [bugfix] CouponList always show empty info

* [bugfix] add click feedback of buttons in components

* [Doc] add custom theme document

* [new feature] Notice bar support more props

* [bugfix] PullRefresh test cases

* [bugfix] unused NoticeBar style

* [bugfix] Swipe width calc error

* [Doc] english document of all action components

* [Doc] change document site path to /zanui/vant

* [Doc] fix

* [bugfix] uploader style error

* [bugfix] tabs document demo

* [new feature] Cell support vue-router target route

* [bugfix] add cell test cases

* update yarn.lock

* [bugfix] Tabbar cann't display info when use icon slot

* [Doc] update document title

* [bugfix] Dialog should reset button text when showed

* [new feature] CouponList add showCloseButton prop
This commit is contained in:
neverland 2017-11-02 05:00:29 -05:00 committed by GitHub
parent d97269084b
commit 7a3fef0a09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 5 deletions

View File

@ -157,6 +157,7 @@ export default {
| exchangeButtonText | 兑换按钮文字 | `String` | `兑换` | - |
| exchangeButtonDisabled | 是否禁用兑换按钮 | `Boolean` | `false` | - |
| displayedCouponIndex | 滚动至特定优惠券位置 | `Number` | - | - |
| showCloseButton | 是否显示列表底部按钮 | `Boolean` | `true` | - |
| closeButtonText | 列表底部按钮文字 | `String` | 不使用优惠 | - |
| disabledListTitle | 不可用券列表标题 | `String` | 不可用优惠 | - |
| inputPlaceholder | 输入框文字提示 | `String` | 请输入优惠码 | - |

View File

@ -25,7 +25,13 @@
<p>暂无优惠券</p>
</div>
</div>
<div class="van-coupon-list__close van-hairline--top" @click="onClickNotUse">{{ closeButtonText }}</div>
<div
v-show="showCloseButton"
class="van-coupon-list__close van-hairline--top"
@click="onClickNotUse"
>
{{ closeButtonText }}
</div>
</div>
</template>
@ -89,6 +95,10 @@ export default {
showExchangeBar: {
type: Boolean,
default: true
},
showCloseButton: {
type: Boolean,
default: true
}
},

View File

@ -7,6 +7,8 @@ const defaultConfig = {
value: true,
title: '',
message: '',
confirmButtonText: '确认',
cancelButtonText: '取消',
showCancelButton: false,
closeOnClickOverlay: false,
callback: action => {

View File

@ -90,7 +90,7 @@ describe('Sku', (done) => {
// 未选择完整规格时弹出toast提示
buyBtn.trigger('click');
wrapper.vm.$nextTick(() => {
const toastText = document.querySelector('.van-toast__text');
const toastText = document.querySelector('.van-toast div');
expect(toastText.textContent).to.equal('请选择完整的规格');
expect(buyCallback.calledOnce).to.be.false;
@ -133,7 +133,7 @@ describe('Sku', (done) => {
const minusBtn = wrapper.find('.van-stepper__minus')[0];
minusBtn.trigger('click');
wrapper.vm.$nextTick(() => {
const toastText = document.querySelector('.van-toast__text');
const toastText = document.querySelector('.van-toast div');
expect(toastText.textContent).to.equal('至少选择一件');
// 手动修改购买数量
@ -203,7 +203,7 @@ describe('Sku', (done) => {
buyBtn.trigger('click');
wrapper.vm.$nextTick(() => {
const toastText = document.querySelector('.van-toast__text');
const toastText = document.querySelector('.van-toast div');
expect(toastText.textContent).to.equal('请填写正确的身份证号码');
inputs[1].element.value = 330101198801012211;
@ -277,7 +277,7 @@ describe('Sku', (done) => {
wrapper.vm.$nextTick(() => {
buyBtn.trigger('click');
wrapper.vm.$nextTick(() => {
const toastText = document.querySelector('.van-toast__text');
const toastText = document.querySelector('.van-toast div');
expect(toastText.textContent).to.equal('商品已经无法购买啦');
const plusBtn = wrapper.find('.van-stepper__plus')[0];