From f9333f5f782b5dd9daa8e83acf0bb5ded35a29b9 Mon Sep 17 00:00:00 2001 From: alger Date: Sat, 14 Dec 2024 13:00:06 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix:=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E6=97=B6=20=E4=BD=BF=E7=94=A8=E7=A9=BA?= =?UTF-8?q?=E6=A0=BC=E5=AF=BC=E8=87=B4=E7=9A=84=E7=A9=BA=E6=A0=BC=E5=BF=AB?= =?UTF-8?q?=E6=8D=B7=E9=94=AE=E5=86=B2=E7=AA=81=E9=97=AE=E9=A2=98=EF=BC=88?= =?UTF-8?q?#18=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fixes #18 --- src/hooks/MusicHook.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/hooks/MusicHook.ts b/src/hooks/MusicHook.ts index cbdb9bd..f28a2fe 100644 --- a/src/hooks/MusicHook.ts +++ b/src/hooks/MusicHook.ts @@ -19,6 +19,12 @@ export const playMusic = computed(() => store.state.playMusic as SongResult); // export const sound = ref(audioService.getCurrentSound()); document.onkeyup = (e) => { + // 检查事件目标是否是输入框元素 + const target = e.target as HTMLElement; + if (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA') { + return; + } + switch (e.code) { case 'Space': if (store.state.play) { @@ -126,7 +132,7 @@ export const getLrcIndex = (time: number): number => { return nowIndex.value; }; -// 获取当前播放歌词进度 +// 获取���前播放歌词进度 const currentLrcTiming = computed(() => { const start = lrcTimeArray.value[nowIndex.value] || 0; const end = lrcTimeArray.value[nowIndex.value + 1] || start + 1; @@ -230,7 +236,7 @@ watch( () => lrcArray.value, (newLrcArray) => { if (newLrcArray.length > 0 && isElectron.value) { - // 重新初始化歌词数据 + // 重新初始��歌词数据 initLyricWindow(); // 发送当前状态 sendLyricToWin();