diff --git a/packages/button/README.md b/packages/button/README.md index fd684ea6..c7026262 100644 --- a/packages/button/README.md +++ b/packages/button/README.md @@ -120,6 +120,7 @@ | size | 按钮尺寸,可选值为 `normal` `large` `small` `mini` | _string_ | `normal` | - | | color | 按钮颜色,支持传入`linear-gradient`渐变色 | _string_ | - | 1.0.0 | | icon | 左侧图标名称或图片链接,可选值见 [Icon 组件](#/icon) | _string_ | - | - | +| class-prefix | 类名前缀 用法等同于[Icon 组件](#/icon) | _string_ | `van-icon` | - | | plain | 是否为朴素按钮 | _boolean_ | `false` | - | | block | 是否为块级元素 | _boolean_ | `false` | - | | round | 是否为圆形按钮 | _boolean_ | `false` | - | diff --git a/packages/button/index.ts b/packages/button/index.ts index 7d38c746..d19e2edb 100644 --- a/packages/button/index.ts +++ b/packages/button/index.ts @@ -13,6 +13,10 @@ VantComponent({ props: { icon: String, + classPrefix: { + type: String, + value: 'van-icon', + }, plain: Boolean, block: Boolean, round: Boolean, @@ -73,7 +77,7 @@ VantComponent({ this.$emit('click'); } }, - + noop() {}, }, }); diff --git a/packages/button/index.wxml b/packages/button/index.wxml index 65a5c3e3..ae61b6b9 100644 --- a/packages/button/index.wxml +++ b/packages/button/index.wxml @@ -31,10 +31,7 @@ type="{{ loadingType }}" color="{{ loadingColor(type,color,plain) }}" /> - + {{ loadingText }} @@ -43,6 +40,7 @@ wx:if="{{ icon }}" size="1.2em" name="{{ icon }}" + class-prefix="{{classPrefix}}" class="van-button__icon" custom-style="line-height: inherit;" />