From 7abc087d70911e318dc5411994f1ba2f917b10bb Mon Sep 17 00:00:00 2001 From: alger Date: Wed, 18 Sep 2024 17:05:36 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20=E6=B7=BB=E5=8A=A0=E6=92=AD?= =?UTF-8?q?=E6=94=BE=E5=88=97=E8=A1=A8=E8=87=AA=E5=8A=A8=E6=BB=9A=E5=8A=A8?= =?UTF-8?q?=E5=88=B0=E6=92=AD=E6=94=BE=E7=9A=84=E9=82=A3=E4=B8=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/SongItem.vue | 3 +++ src/layout/components/PlayBar.vue | 23 ++++++++++++++++++++--- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/src/components/common/SongItem.vue b/src/components/common/SongItem.vue index 8b0cfe2..ec414b3 100644 --- a/src/components/common/SongItem.vue +++ b/src/components/common/SongItem.vue @@ -75,6 +75,9 @@ const emits = defineEmits(['play']); const songImageRef = useTemplateRef('songImg'); const imageLoad = async () => { + if (!songImageRef.value) { + return; + } const background = await getImageBackground((songImageRef.value as any).imageRef as unknown as HTMLImageElement); // eslint-disable-next-line vue/no-mutating-props props.item.backgroundColor = background; diff --git a/src/layout/components/PlayBar.vue b/src/layout/components/PlayBar.vue index f095233..c3fda07 100644 --- a/src/layout/components/PlayBar.vue +++ b/src/layout/components/PlayBar.vue @@ -73,7 +73,15 @@ 歌词 - +