fix: ask before remove track from playlist

master
qier222 4 years ago
parent 80a324524a
commit 70ef845572

@ -11,19 +11,20 @@
<hr /> <hr />
<div class="item" @click="play">{{ $t("contextMenu.play") }}</div> <div class="item" @click="play">{{ $t("contextMenu.play") }}</div>
<div class="item" @click="playNext">{{ $t("contextMenu.playNext") }}</div> <div class="item" @click="playNext">{{ $t("contextMenu.playNext") }}</div>
<hr />
<div class="item" @click="like" v-show="!isRightClickedTrackLiked"> <div class="item" @click="like" v-show="!isRightClickedTrackLiked">
{{ $t("contextMenu.saveToMyLikedSongs") }} {{ $t("contextMenu.saveToMyLikedSongs") }}
</div> </div>
<div class="item" @click="like" v-show="isRightClickedTrackLiked"> <div class="item" @click="like" v-show="isRightClickedTrackLiked">
{{ $t("contextMenu.removeFromMyLikedSongs") }} {{ $t("contextMenu.removeFromMyLikedSongs") }}
</div> </div>
<div class="item" @click="addTrackToPlaylist"></div>
<div <div
v-if="extraContextMenuItem.includes('removeTrackFromPlaylist')" v-if="extraContextMenuItem.includes('removeTrackFromPlaylist')"
class="item" class="item"
@click="removeTrackFromPlaylist" @click="removeTrackFromPlaylist"
>从歌单中删除</div >从歌单中删除</div
> >
<div class="item" @click="addTrackToPlaylist"></div>
</ContextMenu> </ContextMenu>
<TrackListItem <TrackListItem
v-for="track in tracks" v-for="track in tracks"
@ -195,6 +196,7 @@ export default {
this.showToast("此操作需要登录网易云账号"); this.showToast("此操作需要登录网易云账号");
return; return;
} }
if (confirm(`确定要从歌单删除 ${this.rightClickedTrack.name}`)) {
let trackID = this.rightClickedTrack.id; let trackID = this.rightClickedTrack.id;
addOrRemoveTrackFromPlaylist({ addOrRemoveTrackFromPlaylist({
op: "del", op: "del",
@ -206,6 +208,7 @@ export default {
); );
this.$parent.removeTrack(trackID); this.$parent.removeTrack(trackID);
}); });
}
}, },
}, },
}; };

Loading…
Cancel
Save