diff --git a/src/button/README.md b/src/button/README.md index 937e3409a..b036da8ca 100644 --- a/src/button/README.md +++ b/src/button/README.md @@ -104,4 +104,6 @@ bindchooseavatar | Eventhandle | - | 获取用户头像回调,open-type=choose 名称 | 参数 | 描述 -- | -- | -- -tap | `event` | 点击按钮,当按钮不为加载或禁用状态时触发 +tap | `event` | (即将废弃,建议使用 `click`)点击按钮,当按钮不为加载或禁用状态时触发 +click | `event` | 点击按钮,当按钮不为加载或禁用状态时触发 + diff --git a/src/button/button.ts b/src/button/button.ts index c678b0fc5..092672f78 100644 --- a/src/button/button.ts +++ b/src/button/button.ts @@ -94,6 +94,7 @@ export default class Button extends SuperComponent { handleTap(e) { if (this.data.disabled || this.data.loading) return; + this.triggerEvent('click', e); this.triggerEvent('tap', e); }, }; diff --git a/src/button/button.wxml b/src/button/button.wxml index 24f84fd08..31e4c1544 100644 --- a/src/button/button.wxml +++ b/src/button/button.wxml @@ -18,7 +18,7 @@ send-message-img="{{sendMessageImg}}" app-parameter="{{appParameter}}" show-message-card="{{showMessageCard}}" - catch:tap="handleTap" + bind:tap="handleTap" bind:getuserinfo="getuserinfo" bind:contact="contact" bind:getphonenumber="getphonenumber" diff --git a/src/calendar/__test__/__snapshots__/index.test.js.snap b/src/calendar/__test__/__snapshots__/index.test.js.snap index 7b7a84a67..a4b487a8a 100644 --- a/src/calendar/__test__/__snapshots__/index.test.js.snap +++ b/src/calendar/__test__/__snapshots__/index.test.js.snap @@ -771,7 +771,7 @@ exports[`calendar :base 1`] = ` bind:getuserinfo="getuserinfo" bind:launchapp="launchapp" bind:opensetting="opensetting" - catch:tap="handleTap" + bind:tap="handleTap" > 基础图片预览 @@ -34,12 +34,12 @@ exports[`ImageViewer ImageViewer delete demo works fine 1`] = ` size="large" theme="primary" variant="outline" - bind:tap="clickHandle" + bind:tap="onClick" > 带操作图片预览 -