From db21fc94bef55d057194f779344f950afd502ac0 Mon Sep 17 00:00:00 2001 From: ZiuChen <457353192@qq.com> Date: Fri, 19 Aug 2022 18:14:27 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20Mac=E4=B8=8B#13=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E5=A4=8D=E7=8E=B0=20#23?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Main.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/views/Main.vue b/src/views/Main.vue index 1cff0cd..d64f4e8 100644 --- a/src/views/Main.vue +++ b/src/views/Main.vue @@ -123,7 +123,7 @@ onMounted(() => { // 监听键盘事件 document.addEventListener('keydown', (e) => { - const { key, ctrlKey } = e + const { key, ctrlKey, metaKey } = e const isTab = key === 'Tab' const isSearch = key === '/' || @@ -143,7 +143,9 @@ onMounted(() => { filterText.value = '' e.stopPropagation() } - } else if (ctrlKey) { + } else if (ctrlKey || metaKey) { + // 仅有 Ctrl时 什么也不执行 + // utools模拟执行粘贴时触发 } else { window.focus() // 其他键盘事件 直接聚焦搜索框 }