Merge pull request #230 from first19326/dev

fix: 修复了播放器未加载完成或加载失败时,键盘控制事件仍旧生效的问题
This commit is contained in:
底层用户 2024-01-03 13:48:13 +08:00 committed by GitHub
commit c068f676d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 5 deletions

View File

@ -14,7 +14,7 @@
"lint": "eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts,.vue --fix" "lint": "eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts,.vue --fix"
}, },
"dependencies": { "dependencies": {
"@worstone/vue-aplayer": "^1.0.4", "@worstone/vue-aplayer": "^1.0.6",
"aplayer": "^1.10.1", "aplayer": "^1.10.1",
"axios": "^1.6.3", "axios": "^1.6.3",
"element-plus": "^2.4.4", "element-plus": "^2.4.4",

View File

@ -6,8 +6,8 @@ settings:
dependencies: dependencies:
'@worstone/vue-aplayer': '@worstone/vue-aplayer':
specifier: ^1.0.4 specifier: ^1.0.6
version: 1.0.4 version: 1.0.6
aplayer: aplayer:
specifier: ^1.10.1 specifier: ^1.10.1
version: 1.10.1 version: 1.10.1
@ -1899,8 +1899,8 @@ packages:
- vue - vue
dev: false dev: false
/@worstone/vue-aplayer@1.0.4: /@worstone/vue-aplayer@1.0.6:
resolution: {integrity: sha512-74zJaAsuNa20TjmDI4cpsk38vmP3v+mW+uTj5AhGjikzIEkPmVcHg+cNrX8G6ar7m8I+p4li/VRF0Ufu6JPJ5w==} resolution: {integrity: sha512-si0ShhO9xuENpFQdpJqKEWy3NR1Lt0r+T88u/gwZVw3b15CUizhrWpn8QdM08Ele+7FFkegsd2YDyANYhGtR6A==}
dependencies: dependencies:
smoothscroll: 0.4.0 smoothscroll: 0.4.0
vue: 3.4.3 vue: 3.4.3

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();
} }