fix(Button): add loading color when plain is true (#2746)

This commit is contained in:
Lindy 2020-02-12 12:21:59 +08:00 committed by GitHub
parent bfa648b13b
commit 45d0a32eab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -28,7 +28,7 @@
custom-class="loading-class"
size="{{ loadingSize }}"
type="{{ loadingType }}"
color="{{ type === 'default' ? '#c9c9c9' : 'white' }}"
color="{{ loadingColor(type,color,plain) }}"
/>
<view
wx:if="{{ loadingText }}"
@ -50,3 +50,19 @@
</view>
</block>
</button>
<wxs module="loadingColor">
function get(type, color,plain) {
if(plain) {
return color ? color: '#c9c9c9';
}
if(type === 'default') {
return '#c9c9c9';
}
return 'white';
}
module.exports = get;
</wxs>