From 48a00011047a6961cded58d3a48b6e09a9c36f31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E5=A4=A9?= Date: Fri, 29 Jan 2021 18:08:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E6=8B=BC=E5=86=99=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/css/reset-basic.css | 2 +- src/form/button.wc | 6 +++--- src/form/input.wc | 5 ++++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/css/reset-basic.css b/src/css/reset-basic.css index 0c0ec12..e1d5869 100644 --- a/src/css/reset-basic.css +++ b/src/css/reset-basic.css @@ -44,7 +44,7 @@ code, pre, samp {font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; --color-teal-1: rgb(72, 201, 176); --color-teal-2: rgb(26, 188, 156); --color-teal-3: rgb(22, 160, 133); - /* sucess */ + /* success */ --color-green-a: rgba(88, 214, 141, 0.5); --color-green-1: rgb(88, 214, 141); --color-green-2: rgb(46, 204, 113); diff --git a/src/form/button.wc b/src/form/button.wc index 0cd01a7..4925bc0 100644 --- a/src/form/button.wc +++ b/src/form/button.wc @@ -188,13 +188,13 @@ } // -------- -:host([type='sucess']:not([link])) button { +:host([type='success']:not([link])) button { background: var(--color-green-2); } :host([type='success'][link]) button { color: var(--color-green-2); } -:host([type='sucess']:not([disabled]):not([loading]):not([link])) button { +:host([type='success']:not([disabled]):not([loading]):not([link])) button { &:hover { background: var(--color-green-1); } @@ -202,7 +202,7 @@ background: var(--color-green-3); } } -:host([type='sucess']:focus-within:not([link])) { +:host([type='success']:focus-within:not([link])) { box-shadow: 0 0 0 2px var(--color-green-a); } diff --git a/src/form/input.wc b/src/form/input.wc index dab0cf0..0a3a2fa 100644 --- a/src/form/input.wc +++ b/src/form/input.wc @@ -459,7 +459,7 @@ export default class Input { mounted() { var prepend = this.__PREPEND__.assignedNodes() var append = this.__APPEND__.assignedNodes() - var { passwd } = this.props + this.stamp = 0 // 相同插槽, 只允许1个 @@ -479,6 +479,8 @@ export default class Input { // 键盘事件 this._handleSubmit = $.catch(this.__INPUT__, 'keydown', ev => { + let { passwd } = this.props + if (this.disabled || this.readOnly) { return } @@ -504,6 +506,7 @@ export default class Input { // 输入状态事件 this._handleChange = $.bind(this.__INPUT__, 'input', ev => { let now = Date.now() + let { lazy } = this.props // 并发拦截 if (lazy && now - this.stamp < lazy) {