mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
[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:
parent
d97269084b
commit
7a3fef0a09
@ -157,6 +157,7 @@ export default {
|
|||||||
| exchangeButtonText | 兑换按钮文字 | `String` | `兑换` | - |
|
| exchangeButtonText | 兑换按钮文字 | `String` | `兑换` | - |
|
||||||
| exchangeButtonDisabled | 是否禁用兑换按钮 | `Boolean` | `false` | - |
|
| exchangeButtonDisabled | 是否禁用兑换按钮 | `Boolean` | `false` | - |
|
||||||
| displayedCouponIndex | 滚动至特定优惠券位置 | `Number` | - | - |
|
| displayedCouponIndex | 滚动至特定优惠券位置 | `Number` | - | - |
|
||||||
|
| showCloseButton | 是否显示列表底部按钮 | `Boolean` | `true` | - |
|
||||||
| closeButtonText | 列表底部按钮文字 | `String` | 不使用优惠 | - |
|
| closeButtonText | 列表底部按钮文字 | `String` | 不使用优惠 | - |
|
||||||
| disabledListTitle | 不可用券列表标题 | `String` | 不可用优惠 | - |
|
| disabledListTitle | 不可用券列表标题 | `String` | 不可用优惠 | - |
|
||||||
| inputPlaceholder | 输入框文字提示 | `String` | 请输入优惠码 | - |
|
| inputPlaceholder | 输入框文字提示 | `String` | 请输入优惠码 | - |
|
||||||
|
@ -25,7 +25,13 @@
|
|||||||
<p>暂无优惠券</p>
|
<p>暂无优惠券</p>
|
||||||
</div>
|
</div>
|
||||||
</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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -89,6 +95,10 @@ export default {
|
|||||||
showExchangeBar: {
|
showExchangeBar: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true
|
default: true
|
||||||
|
},
|
||||||
|
showCloseButton: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -7,6 +7,8 @@ const defaultConfig = {
|
|||||||
value: true,
|
value: true,
|
||||||
title: '',
|
title: '',
|
||||||
message: '',
|
message: '',
|
||||||
|
confirmButtonText: '确认',
|
||||||
|
cancelButtonText: '取消',
|
||||||
showCancelButton: false,
|
showCancelButton: false,
|
||||||
closeOnClickOverlay: false,
|
closeOnClickOverlay: false,
|
||||||
callback: action => {
|
callback: action => {
|
||||||
|
@ -90,7 +90,7 @@ describe('Sku', (done) => {
|
|||||||
// 未选择完整规格时,弹出toast提示
|
// 未选择完整规格时,弹出toast提示
|
||||||
buyBtn.trigger('click');
|
buyBtn.trigger('click');
|
||||||
wrapper.vm.$nextTick(() => {
|
wrapper.vm.$nextTick(() => {
|
||||||
const toastText = document.querySelector('.van-toast__text');
|
const toastText = document.querySelector('.van-toast div');
|
||||||
expect(toastText.textContent).to.equal('请选择完整的规格');
|
expect(toastText.textContent).to.equal('请选择完整的规格');
|
||||||
expect(buyCallback.calledOnce).to.be.false;
|
expect(buyCallback.calledOnce).to.be.false;
|
||||||
|
|
||||||
@ -133,7 +133,7 @@ describe('Sku', (done) => {
|
|||||||
const minusBtn = wrapper.find('.van-stepper__minus')[0];
|
const minusBtn = wrapper.find('.van-stepper__minus')[0];
|
||||||
minusBtn.trigger('click');
|
minusBtn.trigger('click');
|
||||||
wrapper.vm.$nextTick(() => {
|
wrapper.vm.$nextTick(() => {
|
||||||
const toastText = document.querySelector('.van-toast__text');
|
const toastText = document.querySelector('.van-toast div');
|
||||||
expect(toastText.textContent).to.equal('至少选择一件');
|
expect(toastText.textContent).to.equal('至少选择一件');
|
||||||
|
|
||||||
// 手动修改购买数量
|
// 手动修改购买数量
|
||||||
@ -203,7 +203,7 @@ describe('Sku', (done) => {
|
|||||||
buyBtn.trigger('click');
|
buyBtn.trigger('click');
|
||||||
|
|
||||||
wrapper.vm.$nextTick(() => {
|
wrapper.vm.$nextTick(() => {
|
||||||
const toastText = document.querySelector('.van-toast__text');
|
const toastText = document.querySelector('.van-toast div');
|
||||||
expect(toastText.textContent).to.equal('请填写正确的身份证号码');
|
expect(toastText.textContent).to.equal('请填写正确的身份证号码');
|
||||||
|
|
||||||
inputs[1].element.value = 330101198801012211;
|
inputs[1].element.value = 330101198801012211;
|
||||||
@ -277,7 +277,7 @@ describe('Sku', (done) => {
|
|||||||
wrapper.vm.$nextTick(() => {
|
wrapper.vm.$nextTick(() => {
|
||||||
buyBtn.trigger('click');
|
buyBtn.trigger('click');
|
||||||
wrapper.vm.$nextTick(() => {
|
wrapper.vm.$nextTick(() => {
|
||||||
const toastText = document.querySelector('.van-toast__text');
|
const toastText = document.querySelector('.van-toast div');
|
||||||
expect(toastText.textContent).to.equal('商品已经无法购买啦');
|
expect(toastText.textContent).to.equal('商品已经无法购买啦');
|
||||||
|
|
||||||
const plusBtn = wrapper.find('.van-stepper__plus')[0];
|
const plusBtn = wrapper.find('.van-stepper__plus')[0];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user