From f10cf798e5c4ebc2a3c311fe5924d1a9cb21d94a Mon Sep 17 00:00:00 2001 From: xzz2021 Date: Mon, 10 Feb 2025 16:44:31 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E7=99=BB=E5=BD=95=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0enter=E9=94=AE=E8=A7=A6=E5=8F=91=E6=8F=90?= =?UTF-8?q?=E4=BA=A4,=E9=94=81=E5=B1=8F=E7=BB=84=E4=BB=B6=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E8=81=9A=E7=84=A6=E8=BE=93=E5=85=A5=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UserInfo/src/components/LockDialog.vue | 26 ++++++++++++++++--- .../UserInfo/src/components/LockPage.vue | 9 +++++++ src/views/Login/components/LoginForm.vue | 8 +++++- 3 files changed, 39 insertions(+), 4 deletions(-) diff --git a/src/components/UserInfo/src/components/LockDialog.vue b/src/components/UserInfo/src/components/LockDialog.vue index 8861445..a8dc34f 100644 --- a/src/components/UserInfo/src/components/LockDialog.vue +++ b/src/components/UserInfo/src/components/LockDialog.vue @@ -1,6 +1,6 @@ @@ -102,6 +109,8 @@ function handleShowForm(show = false) { :placeholder="t('lock.placeholder')" class="enter-x" v-model="password" + @keydown.enter="unLock" + ref="passwordInputRef" /> {{ t('lock.message') }} diff --git a/src/views/Login/components/LoginForm.vue b/src/views/Login/components/LoginForm.vue index c13b9e0..bcf2efd 100644 --- a/src/views/Login/components/LoginForm.vue +++ b/src/views/Login/components/LoginForm.vue @@ -72,7 +72,13 @@ const schema = reactive([ style: { width: '100%' }, - placeholder: 'admin or test' + placeholder: 'admin or test', + // 按下enter键触发登录 + onKeydown: (_e: any) => { + if (_e.key === 'Enter') { + signIn() + } + } } }, {