fix: 修复切换收藏和不喜欢状态时事件处理逻辑

This commit is contained in:
alger
2025-05-24 10:11:29 +08:00
parent 53bc1774ff
commit dee4515cb3

View File

@@ -74,7 +74,7 @@ export function useSongItem(props: {
// 切换收藏状态
const toggleFavorite = async (e: Event) => {
e.stopPropagation();
e && e.stopPropagation();
const numericId = typeof props.item.id === 'string' ? parseInt(props.item.id, 10) : props.item.id;
if (isFavorite.value) {
@@ -86,7 +86,7 @@ export function useSongItem(props: {
// 切换不喜欢状态
const toggleDislike = async (e: Event) => {
e.stopPropagation();
e && e.stopPropagation();
if (isDislike.value) {
playerStore.removeFromDislikeList(props.item.id);
return;