Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/button/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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_ | - |
Expand Down
1 change: 1 addition & 0 deletions packages/button/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ VantComponent({
value: '20px',
},
color: String,
loadingColor: String,
},

methods: {
Expand Down
2 changes: 1 addition & 1 deletion packages/button/index.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }) }}"
/>
<view wx:if="{{ loadingText }}" class="van-button__loading-text">
{{ loadingText }}
Expand Down
4 changes: 4 additions & 0 deletions packages/button/index.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
Expand Down