From 63acb5b7990f167d470ea7cbcfc273389817d7bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=98=89=E6=B6=B5?= Date: Thu, 14 Sep 2017 20:05:53 +0800 Subject: [PATCH 1/2] Button: fix disabled color wrong when has bottomAction prop --- docs/examples-docs/button.md | 3 ++- packages/coupon-cell/index.vue | 4 ++-- packages/vant-css/src/button.css | 21 ++++++--------------- packages/vant-css/src/search.css | 6 +++++- 4 files changed, 15 insertions(+), 19 deletions(-) diff --git a/docs/examples-docs/button.md b/docs/examples-docs/button.md index a5bfd47d2..6938cbe52 100644 --- a/docs/examples-docs/button.md +++ b/docs/examples-docs/button.md @@ -74,7 +74,8 @@ Vue.component(Button.name, Button); :::demo 加载状态 ```html - + + ``` ::: diff --git a/packages/coupon-cell/index.vue b/packages/coupon-cell/index.vue index 953540e5f..2017c1e16 100644 --- a/packages/coupon-cell/index.vue +++ b/packages/coupon-cell/index.vue @@ -3,8 +3,8 @@
-

{{ amount }}

- {{ coupons[chosenCoupon].condition }} +
{{ amount }}
+
{{ coupons[chosenCoupon].condition }}
diff --git a/packages/vant-css/src/button.css b/packages/vant-css/src/button.css index b058230a3..2cf0fce0a 100644 --- a/packages/vant-css/src/button.css +++ b/packages/vant-css/src/button.css @@ -36,10 +36,6 @@ color: $button-default-color; background-color: $button-default-background-color; border: 1px solid $button-default-border-color; - - &:active { - color: $gray-dark; - } } &--primary { @@ -91,12 +87,6 @@ } } - &--disabled { - color: $button-disabled-color; - background-color: $button-disabled-background-color; - border: 1px solid $button-disabled-border-color; - } - &--block { width: 100%; display: block; @@ -112,13 +102,14 @@ color: $bottom-action-button-default-color; background-color: $bottom-action-button-default-background-color; - &:active { - color: $white; - } - &.van-button--primary { - color: $bottom-action-button-primary-color; background-color: $bottom-action-button-primary-background-color; } } + + &--disabled { + color: $button-disabled-color; + background-color: $button-disabled-background-color; + border: 1px solid $button-disabled-border-color; + } } diff --git a/packages/vant-css/src/search.css b/packages/vant-css/src/search.css index 4c816f9d2..cc165a328 100644 --- a/packages/vant-css/src/search.css +++ b/packages/vant-css/src/search.css @@ -32,8 +32,12 @@ width: 100%; height: 14px; font-size: 14px; - color: $gray-dark; + color: $gray-darker; border: none; + + &::placeholder { + color: $gray-dark; + } } &__cancel { From f50301c2aab900465e89d1c82fbac27b0a98a64b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=98=89=E6=B6=B5?= Date: Thu, 14 Sep 2017 20:18:57 +0800 Subject: [PATCH 2/2] Coupon: fix test case fail --- test/unit/specs/coupon.spec.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/test/unit/specs/coupon.spec.js b/test/unit/specs/coupon.spec.js index 2350607fa..45c5fe334 100644 --- a/test/unit/specs/coupon.spec.js +++ b/test/unit/specs/coupon.spec.js @@ -82,8 +82,7 @@ describe('CouponCell', () => { DOMChecker(wrapper, { text: { - '.van-cell__value--link h2': '新手专用优惠券 省¥1.50', - '.van-cell__value--link span': '下单立减 1.50 元' + '.van-cell__value--link div div': '新手专用优惠券 省¥1.50' }, count: { '.van-cell__right-icon': 1 @@ -102,8 +101,7 @@ describe('CouponCell', () => { DOMChecker(wrapper, { text: { - '.van-cell__value h2': '新手专用优惠券 省¥1.50', - '.van-cell__value span': '下单立减 1.50 元' + '.van-cell__value div div': '新手专用优惠券 省¥1.50' }, count: { '.van-cell__right-icon': 0