fix(GoodsActionButton): incorrect height (#2195)

This commit is contained in:
neverland 2019-10-23 18:00:16 +08:00 committed by GitHub
parent ad657c7c03
commit 8021bb4ee7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 24 deletions

View File

@ -6,26 +6,23 @@
} }
.van-goods-action-button { .van-goods-action-button {
height: 36px !important; height: 40px !important;
font-weight: 500 !important; font-weight: 500 !important;
line-height: 34px !important; line-height: 40px !important;
border: none !important; border: none !important;
.theme(font-size, '@font-size-md') !important;
&--first { &--first {
display: block !important; display: block !important;
width: auto !important;
margin-left: 5px; margin-left: 5px;
border-top-left-radius: 18px !important; border-top-left-radius: 20px !important;
border-bottom-left-radius: 18px !important; border-bottom-left-radius: 20px !important;
} }
&--last { &--last {
display: block !important; display: block !important;
width: auto !important;
margin-right: 5px; margin-right: 5px;
border-top-right-radius: 18px !important; border-top-right-radius: 20px !important;
border-bottom-right-radius: 18px !important; border-bottom-right-radius: 20px !important;
} }
&--warning { &--warning {

View File

@ -33,22 +33,14 @@ VantComponent({
this.$emit('click', event.detail); this.$emit('click', event.detail);
this.jumpLink(); this.jumpLink();
}, },
updateStyle() { updateStyle() {
const { parent } = this; const { children = [] } = this.parent;
const { children = [] } = parent;
const index = children.indexOf(this); 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({ this.setData({
isFirst, isFirst: index === 0,
isLast isLast: index === children.length - 1
}); });
} }
} }

View File

@ -2,7 +2,6 @@
<van-button <van-button
square square
id="{{ id }}" id="{{ id }}"
size="large"
lang="{{ lang }}" lang="{{ lang }}"
type="{{ type }}" type="{{ type }}"
color="{{ color }}" color="{{ color }}"

View File

@ -118,7 +118,7 @@ Page({
| url | 点击后跳转的链接地址 | *string* | - | - | | url | 点击后跳转的链接地址 | *string* | - | - |
| link-type | 链接跳转类型,可选值为 `redirectTo` `switchTab` `reLaunch` | *string* | `navigateTo` | - | | link-type | 链接跳转类型,可选值为 `redirectTo` `switchTab` `reLaunch` | *string* | `navigateTo` | - |
| id | 标识符 | *string* | - | - | | id | 标识符 | *string* | - | - |
| type | 按钮类型,可选值为 `primary` `warning` `danger` | *string* | `default` | - | | type | 按钮类型,可选值为 `primary` `warning` `danger` | *string* | `danger` | - |
| size | 按钮尺寸,可选值为 `normal` `large` `small` `mini` | *string* | `normal` | - | | size | 按钮尺寸,可选值为 `normal` `large` `small` `mini` | *string* | `normal` | - |
| disabled | 是否禁用按钮 | *boolean* | `false` | - | | disabled | 是否禁用按钮 | *boolean* | `false` | - |
| loading | 是否显示为加载状态 | *boolean* | `false` | - | | loading | 是否显示为加载状态 | *boolean* | `false` | - |