From 1820c4187f8fade4fb3bcbdb256b44d84d2c0c92 Mon Sep 17 00:00:00 2001 From: ZiuChen <457353192@qq.com> Date: Tue, 6 Sep 2022 22:31:17 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BA=86=E9=9D=9E?= =?UTF-8?q?=E9=A2=84=E6=9C=9F=E7=9A=84=E6=90=9C=E7=B4=A2=E6=A1=86=E8=81=9A?= =?UTF-8?q?=E7=84=A6=E8=A1=8C=E4=B8=BA=20#33?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Main.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/views/Main.vue b/src/views/Main.vue index 24cad21..b5c72c1 100644 --- a/src/views/Main.vue +++ b/src/views/Main.vue @@ -143,6 +143,8 @@ onMounted(() => { const isSearch = (ctrlKey && (key === 'F' || key === 'f')) || (ctrlKey && (key === 'L' || key === 'l')) const isExit = key === 'Escape' + const isArrow = key === 'ArrowDown' || key === 'ArrowUp' + const isEnter = key === 'Enter' if (isTab) { const tabTypes = tabs.map((item) => item.type) const index = tabTypes.indexOf(activeTab.value) @@ -156,9 +158,8 @@ onMounted(() => { filterText.value = '' e.stopPropagation() } - } else if (ctrlKey || metaKey) { - // 仅有 Ctrl时 什么也不执行 - // utools模拟执行粘贴时触发 + } else if (ctrlKey || metaKey || isArrow || isEnter) { + // 仅有 Ctrl时 什么也不执行 (utools模拟执行粘贴时触发) } else { window.focus() // 其他键盘事件 直接聚焦搜索框 }