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

优化input组件的lazy属性;修复button的样式

old
宇天 2021-03-10 16:52:08 +08:00
parent 964b6093c3
commit 4839b327b9
2 changed files with 9 additions and 0 deletions

View File

@ -65,6 +65,7 @@
} }
:host([size='large'][circle]) { :host([size='large'][circle]) {
min-width: 52px; min-width: 52px;
width: 52px;
height: 52px; height: 52px;
button { button {
@ -81,6 +82,7 @@
} }
:host([size='medium'][circle]) { :host([size='medium'][circle]) {
min-width: 44px; min-width: 44px;
width: 44px;
} }
:host([size='small']) { :host([size='small']) {
width: 96px; width: 96px;

View File

@ -472,6 +472,7 @@ export default class Input {
// 键盘事件 // 键盘事件
this._handleSubmit = $.catch(this.__INPUT__, 'keydown', ev => { this._handleSubmit = $.catch(this.__INPUT__, 'keydown', ev => {
let { passwd } = this.props let { passwd } = this.props
let now = Date.now()
if (this.disabled || this.readOnly) { if (this.disabled || this.readOnly) {
return return
@ -491,6 +492,12 @@ export default class Input {
return this._fetchSelect(this.state.mvidx, ev) return this._fetchSelect(this.state.mvidx, ev)
} }
// 并发拦截
if (lazy && now - this.stamp < lazy) {
return
}
this.stamp = now
this.dispatchEvent(new CustomEvent('submit', { detail: this.value })) this.dispatchEvent(new CustomEvent('submit', { detail: this.value }))
} }
}) })