🐞 fix: 修复各种报错问题

This commit is contained in:
alger
2024-09-12 16:44:42 +08:00
parent e27ed22c16
commit 017b47fded
14 changed files with 61 additions and 60 deletions
-1
View File
@@ -50,7 +50,6 @@ const handleClick = async () => {
if (props.item.type === '专辑') {
showPop.value = true;
const res = await getAlbum(props.item.id);
console.log('res.data', res.data);
songList.value = res.data.songs.map((song: any) => {
song.al.picUrl = song.al.picUrl || props.item.picUrl;
return song;
+5 -5
View File
@@ -7,8 +7,8 @@
</div>
<div class="song-item-content-name">
<n-ellipsis class="text-ellipsis" line-clamp="1">
<span v-for="(artists, artistsindex) in item.song.artists" :key="artistsindex"
>{{ artists.name }}{{ artistsindex < item.song.artists.length - 1 ? ' / ' : '' }}</span
<span v-for="(artists, artistsindex) in item.artists" :key="artistsindex"
>{{ artists.name }}{{ artistsindex < item.artists.length - 1 ? ' / ' : '' }}</span
>
</n-ellipsis>
</div>
@@ -32,12 +32,12 @@
<script lang="ts" setup>
import { useStore } from 'vuex';
import type { SongResult } from '@/type/music';
import type { Song } from '@/type/music';
import { getImgUrl } from '@/utils';
const props = withDefaults(
defineProps<{
item: SongResult;
item: Song;
mini?: boolean;
}>(),
{
@@ -61,7 +61,7 @@ const isPlaying = computed(() => {
const emits = defineEmits(['play']);
// 播放音乐 设置音乐详情 打开音乐底栏
const playMusicEvent = async (item: SongResult) => {
const playMusicEvent = async (item: Song) => {
if (playMusic.value.id === item.id) {
return;
}