diff --git a/packages/button/README.md b/packages/button/README.md index c874fcd08..2161c7cbb 100644 --- a/packages/button/README.md +++ b/packages/button/README.md @@ -136,6 +136,7 @@ | loading-text | 加载状态提示文字 | _string_ | - | | loading-type | 加载状态图标类型,可选值为 `spinner` | _string_ | `circular` | | loading-size | 加载图标大小 | _string_ | `20px` | +| loading-color | 加载图标颜色 | _string_ | - | | custom-style | 自定义样式 | _string_ | - | | open-type | 微信开放能力,具体支持可参考 [微信官方文档](https://developers.weixin.qq.com/miniprogram/dev/component/button.html) | _string_ | - | | app-parameter | 打开 APP 时,向 APP 传递的参数 | _string_ | - | diff --git a/packages/button/index.ts b/packages/button/index.ts index 3eccf8e01..43157f574 100644 --- a/packages/button/index.ts +++ b/packages/button/index.ts @@ -50,6 +50,7 @@ VantComponent({ value: '20px', }, color: String, + loadingColor: String, }, methods: { diff --git a/packages/button/index.wxml b/packages/button/index.wxml index 5694c0e9a..9e5032fe4 100644 --- a/packages/button/index.wxml +++ b/packages/button/index.wxml @@ -34,7 +34,7 @@ custom-class="loading-class" size="{{ loadingSize }}" type="{{ loadingType }}" - color="{{ computed.loadingColor({ type, color, plain }) }}" + color="{{ computed.loadingColor({ loadingColor, type, color, plain }) }}" /> {{ loadingText }} diff --git a/packages/button/index.wxs b/packages/button/index.wxs index 8b649fe18..d739ed377 100644 --- a/packages/button/index.wxs +++ b/packages/button/index.wxs @@ -22,6 +22,10 @@ function rootStyle(data) { } function loadingColor(data) { + if (data.loadingColor) { + return data.loadingColor; + } + if (data.plain) { return data.color ? data.color : '#c9c9c9'; }