From 8021bb4ee7df2e898ad251a7d329c561652f29ac Mon Sep 17 00:00:00 2001 From: neverland Date: Wed, 23 Oct 2019 18:00:16 +0800 Subject: [PATCH] fix(GoodsActionButton): incorrect height (#2195) --- packages/goods-action-button/index.less | 15 ++++++--------- packages/goods-action-button/index.ts | 18 +++++------------- packages/goods-action-button/index.wxml | 1 - packages/goods-action/README.md | 2 +- 4 files changed, 12 insertions(+), 24 deletions(-) diff --git a/packages/goods-action-button/index.less b/packages/goods-action-button/index.less index b9b43c3e..bf725cd0 100644 --- a/packages/goods-action-button/index.less +++ b/packages/goods-action-button/index.less @@ -6,26 +6,23 @@ } .van-goods-action-button { - height: 36px !important; + height: 40px !important; font-weight: 500 !important; - line-height: 34px !important; + line-height: 40px !important; border: none !important; - .theme(font-size, '@font-size-md') !important; &--first { display: block !important; - width: auto !important; margin-left: 5px; - border-top-left-radius: 18px !important; - border-bottom-left-radius: 18px !important; + border-top-left-radius: 20px !important; + border-bottom-left-radius: 20px !important; } &--last { display: block !important; - width: auto !important; margin-right: 5px; - border-top-right-radius: 18px !important; - border-bottom-right-radius: 18px !important; + border-top-right-radius: 20px !important; + border-bottom-right-radius: 20px !important; } &--warning { diff --git a/packages/goods-action-button/index.ts b/packages/goods-action-button/index.ts index 889abcaa..73fffd94 100644 --- a/packages/goods-action-button/index.ts +++ b/packages/goods-action-button/index.ts @@ -33,22 +33,14 @@ VantComponent({ this.$emit('click', event.detail); this.jumpLink(); }, + updateStyle() { - const { parent } = this; - const { children = [] } = parent; + const { children = [] } = this.parent; const index = children.indexOf(this); - const { length } = children; - let isFirst = false; - let isLast = false; - if (index === 0) { - isFirst = true; - } - if (index === length - 1) { - isLast = true; - } + this.setData({ - isFirst, - isLast + isFirst: index === 0, + isLast: index === children.length - 1 }); } } diff --git a/packages/goods-action-button/index.wxml b/packages/goods-action-button/index.wxml index 366b8cd7..d6d2daab 100644 --- a/packages/goods-action-button/index.wxml +++ b/packages/goods-action-button/index.wxml @@ -2,7 +2,6 @@