mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
fix(Button): disabled button does not emit event handler (#2878)
This commit is contained in:
parent
bf0b96c469
commit
6cf1a3b70e
@ -68,7 +68,7 @@ VantComponent({
|
||||
|
||||
methods: {
|
||||
onClick() {
|
||||
if (!this.data.disabled && !this.data.loading) {
|
||||
if (!this.data.loading) {
|
||||
this.$emit('click');
|
||||
}
|
||||
}
|
||||
|
@ -15,13 +15,13 @@
|
||||
show-message-card="{{ showMessageCard }}"
|
||||
app-parameter="{{ appParameter }}"
|
||||
aria-label="{{ ariaLabel }}"
|
||||
bindtap="onClick"
|
||||
bindgetuserinfo="bindGetUserInfo"
|
||||
bindcontact="bindContact"
|
||||
bindgetphonenumber="bindGetPhoneNumber"
|
||||
binderror="bindError"
|
||||
bindlaunchapp="bindLaunchApp"
|
||||
bindopensetting="bindOpenSetting"
|
||||
bindtap="{{ !disabled ? onClick : null }}"
|
||||
bindgetuserinfo="{{ !disabled ? bindGetUserInfo : null }}"
|
||||
bindcontact="{{ !disabled ? bindContact : null }}"
|
||||
bindgetphonenumber="{{ !disabled ? bindGetPhoneNumber : null }}"
|
||||
binderror="{{ !disabled ? bindError : null }}"
|
||||
bindlaunchapp="{{ !disabled ? bindLaunchApp : null}}"
|
||||
bindopensetting="{{ !disabled ? bindOpenSetting : null }}"
|
||||
>
|
||||
<block wx:if="{{ loading }}">
|
||||
<van-loading
|
||||
|
Loading…
x
Reference in New Issue
Block a user