From d98e51e99bd880f8b557a1c19135058d2db7ae9c Mon Sep 17 00:00:00 2001 From: caill <815519168@qq.com> Date: Tue, 21 Nov 2023 18:33:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=B9=E7=AA=97=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/SimpleKeyboard.vue | 11 ++------ src/components/keyboard-input.vue | 11 ++++++++ src/pages/modules/login/login.vue | 37 ++++++++++++++++++++----- src/pages/modules/login/login1.vue | 2 +- src/pages/modules/systemmanage/user.vue | 10 ++++--- src/style/common.styl | 20 +++++++++++-- 6 files changed, 68 insertions(+), 23 deletions(-) diff --git a/src/components/SimpleKeyboard.vue b/src/components/SimpleKeyboard.vue index a48bc84..a9ac0e1 100644 --- a/src/components/SimpleKeyboard.vue +++ b/src/components/SimpleKeyboard.vue @@ -129,15 +129,10 @@ export default { } } else if (button === '{clear}') { this.keyboard.clearInput() - } else { - // let value = $event.target.offsetParent.parentElement.children[0].children[0].value - // // 输入框有默认值时,覆写 - // if (value) { - // this.keyboard.setInput(value) - // } - this.$emit('onKeyPress', button) + } else if (button === '{shift}' || button === '{lock}') { + this.handleShift() } - if (button === '{shift}' || button === '{lock}') this.handleShift() + this.$emit('onKeyPress', button) }, // 切换shift/默认布局 handleShift () { diff --git a/src/components/keyboard-input.vue b/src/components/keyboard-input.vue index 21700e2..1626794 100644 --- a/src/components/keyboard-input.vue +++ b/src/components/keyboard-input.vue @@ -102,6 +102,17 @@ export default { }, 0) }, onKeyPress (button) { + if (button === '{lock}' || button === '{shift}' || button === '{change}' || button === '{bksp}' || button === '{clear}') { + this.$nextTick(() => { + this.inputEle.focus() + }) + setTimeout(() => { + this.inputEle.focus() + }, 0) + } + if (button === '{clear}') { + this.inputValue = '' + } console.log('onKeyPress', button) } } diff --git a/src/pages/modules/login/login.vue b/src/pages/modules/login/login.vue index eb21864..53c7157 100644 --- a/src/pages/modules/login/login.vue +++ b/src/pages/modules/login/login.vue @@ -13,11 +13,21 @@
- + +
- +
@@ -28,11 +38,15 @@
@@ -45,9 +59,13 @@