fix(Button): disabled button does not emit event handler (#2878)

This commit is contained in:
Lindy 2020-03-17 20:22:16 +08:00 committed by GitHub
parent bf0b96c469
commit 6cf1a3b70e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View File

@ -68,7 +68,7 @@ VantComponent({
methods: { methods: {
onClick() { onClick() {
if (!this.data.disabled && !this.data.loading) { if (!this.data.loading) {
this.$emit('click'); this.$emit('click');
} }
} }

View File

@ -15,13 +15,13 @@
show-message-card="{{ showMessageCard }}" show-message-card="{{ showMessageCard }}"
app-parameter="{{ appParameter }}" app-parameter="{{ appParameter }}"
aria-label="{{ ariaLabel }}" aria-label="{{ ariaLabel }}"
bindtap="onClick" bindtap="{{ !disabled ? onClick : null }}"
bindgetuserinfo="bindGetUserInfo" bindgetuserinfo="{{ !disabled ? bindGetUserInfo : null }}"
bindcontact="bindContact" bindcontact="{{ !disabled ? bindContact : null }}"
bindgetphonenumber="bindGetPhoneNumber" bindgetphonenumber="{{ !disabled ? bindGetPhoneNumber : null }}"
binderror="bindError" binderror="{{ !disabled ? bindError : null }}"
bindlaunchapp="bindLaunchApp" bindlaunchapp="{{ !disabled ? bindLaunchApp : null}}"
bindopensetting="bindOpenSetting" bindopensetting="{{ !disabled ? bindOpenSetting : null }}"
> >
<block wx:if="{{ loading }}"> <block wx:if="{{ loading }}">
<van-loading <van-loading