From d40c8eea475ac886c36a92cdb57a33f29f0e6dcd Mon Sep 17 00:00:00 2001 From: zilong Date: Sun, 24 Oct 2021 20:33:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=A0=E9=99=A4=E6=AD=A3?= =?UTF-8?q?=E5=9C=A8=E6=92=AD=E6=94=BE=E5=88=97=E8=A1=A8=E7=9A=84Bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/common/ZPlayingList.vue | 40 ++++++++++++++++--------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/src/views/common/ZPlayingList.vue b/src/views/common/ZPlayingList.vue index 55baf5d..257bb55 100644 --- a/src/views/common/ZPlayingList.vue +++ b/src/views/common/ZPlayingList.vue @@ -106,8 +106,8 @@ const options = [ // key: "nextToPlay", // }, { - type: 'divider', - key: '' + type: "divider", + key: "", }, { label: "从列表删除", @@ -117,20 +117,22 @@ const options = [ // 处理菜单选择 const handleSelect = (key, id) => { - switch(key){ - case 'play': - pubsub.publish('zp.play',{ - id, im: true, - }) + switch (key) { + case "play": + pubsub.publish("zp.play", { + id, + im: true, + }); break; - case 'nextToPlay': + case "nextToPlay": break; - case 'remove': - store.commit('removePlayingList', {id}) - if(playingList.value.length>0) - pubsub.publish('zp.next') - else - pubsub.publish('zp.stop') + case "remove": + store.commit("removePlayingList", { id }); + if (playingList.value.length > 0){ + if (store.state.settings.songId == id) + pubsub.publish("zp.next"); + } + else pubsub.publish("zp.stop"); break; } }; @@ -138,9 +140,9 @@ const handleClick = () => { // showDropdownRef.value = !showDropdownRef.value; }; -const arLeave = ()=>{ - pubsub.publish('zp.togglePlaying',) -} +const arLeave = () => { + pubsub.publish("zp.togglePlaying"); +};