fix: 修复了播放器未加载完成或加载失败时,键盘控制事件仍旧生效的问题

This commit is contained in:
first19326 2024-01-02 23:09:43 +08:00
parent f016348b97
commit 27780c6558

View File

@ -119,6 +119,9 @@ const changeMusicIndex = (type) => {
onMounted(() => { onMounted(() => {
// //
window.addEventListener("keydown", (e) => { window.addEventListener("keydown", (e) => {
if (!store.musicIsOk) {
return ;
}
if (e.code == "Space") { if (e.code == "Space") {
changePlayState(); changePlayState();
} }