diff --git a/packages/button/index.ts b/packages/button/index.ts index e1abc1d9..0a3aad08 100644 --- a/packages/button/index.ts +++ b/packages/button/index.ts @@ -71,6 +71,8 @@ VantComponent({ if (!this.data.loading) { this.$emit('click'); } - } + }, + + noop() {} } }); diff --git a/packages/button/index.wxml b/packages/button/index.wxml index 8429d2fb..09bef324 100644 --- a/packages/button/index.wxml +++ b/packages/button/index.wxml @@ -15,13 +15,13 @@ show-message-card="{{ showMessageCard }}" app-parameter="{{ appParameter }}" aria-label="{{ ariaLabel }}" - 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 }}" + bindtap="{{ !disabled ? 'onClick' : 'noop' }}" + bindgetuserinfo="{{ !disabled ? 'bindGetUserInfo' : 'noop' }}" + bindcontact="{{ !disabled ? 'bindContact' : 'noop' }}" + bindgetphonenumber="{{ !disabled ? 'bindGetPhoneNumber' : 'noop' }}" + binderror="{{ !disabled ? 'bindError' : 'noop' }}" + bindlaunchapp="{{ !disabled ? 'bindLaunchApp' : 'noop' }}" + bindopensetting="{{ !disabled ? 'bindOpenSetting' : 'noop' }}" >