This repository has been archived on 2023-08-30. You can view files and clone it, but cannot push or open issues/pull-requests.
bytedo
/
wcui
Archived
1
0
Fork 0
old
宇天 2021-06-03 01:16:02 +08:00
parent c8078ddfc7
commit 749c28e2f8
2 changed files with 5 additions and 5 deletions

View File

@ -341,23 +341,23 @@ export default class Button {
this.stamp = 0 this.stamp = 0
// 阻止事件冒泡, 避免用户自己绑定click事件不受这2个值的限制 // 阻止事件冒泡, 避免用户自己绑定click事件不受这2个值的限制
this._handleClick = $.bind(this.__BTN__, 'click', ev => { this._handleClick = $.catch(this, 'click', ev => {
var { loading, disabled, lazy } = this.props var { loading, disabled, lazy } = this.props
var now = Date.now() var now = Date.now()
if (loading || disabled) { if (loading || disabled) {
return ev.stopPropagation() return ev.preventDefault()
} }
// 并发拦截 // 并发拦截
if (lazy && now - this.stamp < lazy) { if (lazy && now - this.stamp < lazy) {
return ev.stopPropagation() return ev.preventDefault()
} }
this.stamp = now this.stamp = now
}) })
} }
unmounted() { unmounted() {
$.unbind(this.__BTN__, 'click', this._handleClick) $.unbind(this, 'click', this._handleClick)
} }
watch() { watch() {

View File

@ -508,7 +508,7 @@ export default class Input {
// 并发拦截 intercept // 并发拦截 intercept
if (lazy && now - this.stamp < lazy) { if (lazy && now - this.stamp < lazy) {
this.dispatchEvent(new CustomEvent('intercept')) // this.dispatchEvent(new CustomEvent('intercept'))
return return
} }