From 8448b293a90ffdc92bd53a86bc7ff9abf12a3dbb Mon Sep 17 00:00:00 2001 From: zilong Date: Wed, 20 Oct 2021 23:12:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E5=A7=8B=E5=BC=80=E5=8F=91"=E6=AD=A3?= =?UTF-8?q?=E5=9C=A8=E6=92=AD=E6=94=BE"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 43 +++++++++++++-- src/main.js | 1 + src/views/Played.vue | 2 + src/views/common/SongCtrl.vue | 2 +- src/views/common/SongInfo.vue | 6 ++- src/views/common/SongStatus.vue | 3 +- src/views/discover/Recommend.vue | 12 ++++- yarn.lock | 89 +++++++++++++++++++++++++------- 8 files changed, 128 insertions(+), 30 deletions(-) diff --git a/src/App.vue b/src/App.vue index 5265546..b396504 100644 --- a/src/App.vue +++ b/src/App.vue @@ -34,6 +34,8 @@ const store = useStore(); store.commit("loadSettings"); store.commit("loadCaches"); +const showPlaying = ref(false); //是否显示播放列表 + //处理route消息 const routeToken = pubsub.subscribe( "router", @@ -49,9 +51,18 @@ const routeToken = pubsub.subscribe( } ); +const token = pubsub.subscribe("zp", (msg, data) => { + switch (msg) { + case "zp.togglePlaying": + showPlaying.value = !showPlaying.value; + break; + } +}); + //卸载组件 onUnmounted(() => { pubsub.unsubscribe(routeToken); + pubsub.unsubscribe(token); }); @@ -77,10 +88,13 @@ onUnmounted(() => { +
+
+