修改删除正在播放列表的Bug

This commit is contained in:
zilong 2021-10-24 20:33:18 +08:00
parent 9c7b484b36
commit d40c8eea47

View File

@ -106,8 +106,8 @@ const options = [
// key: "nextToPlay", // key: "nextToPlay",
// }, // },
{ {
type: 'divider', type: "divider",
key: '' key: "",
}, },
{ {
label: "从列表删除", label: "从列表删除",
@ -117,20 +117,22 @@ const options = [
// //
const handleSelect = (key, id) => { const handleSelect = (key, id) => {
switch(key){ switch (key) {
case 'play': case "play":
pubsub.publish('zp.play',{ pubsub.publish("zp.play", {
id, im: true, id,
}) im: true,
});
break; break;
case 'nextToPlay': case "nextToPlay":
break; break;
case 'remove': case "remove":
store.commit('removePlayingList', {id}) store.commit("removePlayingList", { id });
if(playingList.value.length>0) if (playingList.value.length > 0){
pubsub.publish('zp.next') if (store.state.settings.songId == id)
else pubsub.publish("zp.next");
pubsub.publish('zp.stop') }
else pubsub.publish("zp.stop");
break; break;
} }
}; };
@ -138,9 +140,9 @@ const handleClick = () => {
// showDropdownRef.value = !showDropdownRef.value; // showDropdownRef.value = !showDropdownRef.value;
}; };
const arLeave = ()=>{ const arLeave = () => {
pubsub.publish('zp.togglePlaying',) pubsub.publish("zp.togglePlaying");
} };
</script> </script>
<template> <template>
@ -159,7 +161,7 @@ const arLeave = ()=>{
@dragenter="dragenter($event, idx)" @dragenter="dragenter($event, idx)"
@dragover="dragover($event, idx)" @dragover="dragover($event, idx)"
@drop="drop($event, idx)" @drop="drop($event, idx)"
@dblclick="pubsub.publish('zp.play', {id: p.id,im: true})" @dblclick="pubsub.publish('zp.play', { id: p.id, im: true })"
> >
<div class="icon"> <div class="icon">
<NButton <NButton
@ -198,7 +200,7 @@ const arLeave = ()=>{
</span> </span>
</div> </div>
<div class="ar"> <div class="ar">
<ArtistsSpan :artists="p.artists" :onLeave="arLeave"/> <ArtistsSpan :artists="p.artists" :onLeave="arLeave" />
</div> </div>
<div class="al">{{ p.album.name }}</div> <div class="al">{{ p.album.name }}</div>
<div class="dt"> <div class="dt">