From 749c28e2f8ae8369243b06449d25598d7cdd4866 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E5=A4=A9?= Date: Thu, 3 Jun 2021 01:16:02 +0800 Subject: [PATCH] fixed --- src/form/button.wc | 8 ++++---- src/form/input.wc | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/form/button.wc b/src/form/button.wc index 6467e96..4710fcd 100644 --- a/src/form/button.wc +++ b/src/form/button.wc @@ -341,23 +341,23 @@ export default class Button { this.stamp = 0 // 阻止事件冒泡, 避免用户自己绑定click事件不受这2个值的限制 - this._handleClick = $.bind(this.__BTN__, 'click', ev => { + this._handleClick = $.catch(this, 'click', ev => { var { loading, disabled, lazy } = this.props var now = Date.now() if (loading || disabled) { - return ev.stopPropagation() + return ev.preventDefault() } // 并发拦截 if (lazy && now - this.stamp < lazy) { - return ev.stopPropagation() + return ev.preventDefault() } this.stamp = now }) } unmounted() { - $.unbind(this.__BTN__, 'click', this._handleClick) + $.unbind(this, 'click', this._handleClick) } watch() { diff --git a/src/form/input.wc b/src/form/input.wc index b793260..15e023c 100644 --- a/src/form/input.wc +++ b/src/form/input.wc @@ -508,7 +508,7 @@ export default class Input { // 并发拦截 intercept if (lazy && now - this.stamp < lazy) { - this.dispatchEvent(new CustomEvent('intercept')) + // this.dispatchEvent(new CustomEvent('intercept')) return }