From 14d6e2a315e6aae827c109de7f43d051e09138dd Mon Sep 17 00:00:00 2001 From: Aicirou <2643053021@qq.com> Date: Fri, 21 Aug 2020 22:23:21 +0800 Subject: [PATCH] :bug: Fix the need to refresh to display the player when playing audio --- src/store/modules/acrou/modules/aplayer.js | 1 - src/views/common/APlayer.vue | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/store/modules/acrou/modules/aplayer.js b/src/store/modules/acrou/modules/aplayer.js index 1a7d7de..5f9e6d7 100644 --- a/src/store/modules/acrou/modules/aplayer.js +++ b/src/store/modules/acrou/modules/aplayer.js @@ -13,7 +13,6 @@ export default { add({ state, dispatch }, { audio, play }) { return new Promise((resolve) => { var index = state.openedAudios.findIndex((s) => s.id === audio.id); - console.log(index); if (index >= 0) { state.openedAudios.splice(index, 1); state.player.list.remove(index + state.customAudios.length || 0); diff --git a/src/views/common/APlayer.vue b/src/views/common/APlayer.vue index 49dfd7b..b22795e 100644 --- a/src/views/common/APlayer.vue +++ b/src/views/common/APlayer.vue @@ -18,7 +18,7 @@ export default { }); }, computed: { - ...mapState("acrou/aplayer", ["player", "audios"]), + ...mapState("acrou/aplayer", ["player", "audios", "openedAudios"]), container() { return document.getElementById("aplayer"); }, @@ -36,7 +36,7 @@ export default { }; }, show() { - return this.audios && this.audios.length > 0; + return (this.audios && this.audios.length > 0) || (this.openedAudios && this.openedAudios.length > 0); }, }, methods: {