diff --git a/packages/button/index.less b/packages/button/index.less index b240173e..dc0e6015 100644 --- a/packages/button/index.less +++ b/packages/button/index.less @@ -2,35 +2,35 @@ .van-button { position: relative; - padding: 0; display: inline-block; height: 44px; + padding: 0; + font-size: 16px; line-height: 42px; + text-align: center; + -webkit-text-size-adjust: 100%; + vertical-align: middle; border-radius: 2px; box-sizing: border-box; - font-size: 16px; - text-align: center; - vertical-align: middle; -webkit-appearance: none; - -webkit-text-size-adjust: 100%; &::after { - content: " "; position: absolute; top: 50%; left: 50%; - opacity: 0; width: 100%; height: 100%; + background-color: @black; border: inherit; border-color: @black; - background-color: @black; border-radius: inherit; /* inherit parent's border radius */ + content: ' '; + opacity: 0; transform: translate(-50%, -50%); } - &:active::after { - opacity: .15; + &--active::after { + opacity: 0.15; } &--unclickable::after { @@ -90,8 +90,8 @@ &--small { height: 30px; - padding: 0 8px; min-width: 60px; + padding: 0 8px; font-size: 12px; line-height: 28px; } @@ -101,8 +101,8 @@ display: inline-block; width: 50px; height: 22px; - line-height: 20px; font-size: 10px; + line-height: 20px; & + .van-button--mini { margin-left: 5px; @@ -110,8 +110,8 @@ } &--block { - width: 100%; display: block; + width: 100%; } &--round { @@ -123,6 +123,6 @@ } &--disabled { - opacity: .5; + opacity: 0.5; } } diff --git a/packages/button/index.ts b/packages/button/index.ts index 94b03143..6ecc9ae4 100644 --- a/packages/button/index.ts +++ b/packages/button/index.ts @@ -3,10 +3,10 @@ import { button } from '../mixins/button'; import { openType } from '../mixins/open-type'; VantComponent({ - classes: ['loading-class'], - mixins: [button, openType], + classes: ['hover-class', 'loading-class'], + props: { plain: Boolean, block: Boolean, diff --git a/packages/button/index.wxml b/packages/button/index.wxml index 68f22736..3c18b206 100644 --- a/packages/button/index.wxml +++ b/packages/button/index.wxml @@ -2,21 +2,26 @@