Skip to content

Commit

Permalink
fix: 修复了播放器未加载完成或加载失败时,键盘控制事件仍旧生效的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
first19326 committed Jan 2, 2024
1 parent f016348 commit 27780c6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/components/Music.vue
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ const changeMusicIndex = (type) => {
onMounted(() => {
// 空格键事件
window.addEventListener("keydown", (e) => {
if (!store.musicIsOk) {
return ;
}
if (e.code == "Space") {
changePlayState();
}
Expand Down

0 comments on commit 27780c6

Please sign in to comment.