From d073ea2767e73c3331e81a687e69f90314c17649 Mon Sep 17 00:00:00 2001 From: rex Date: Fri, 20 Mar 2020 16:03:30 +0800 Subject: [PATCH] fix(Button): fix click not work (#2892) --- packages/button/index.ts | 4 +++- packages/button/index.wxml | 14 +++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) 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' }}" >