From 27ff1bdab92b7f6ce767b78af331628deffd27a2 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Wed, 12 Jul 2023 22:27:02 +0800 Subject: [PATCH] fix downloading card --- src/components/cards/DownloadingCard.vue | 70 +++++++++++++----------- 1 file changed, 39 insertions(+), 31 deletions(-) diff --git a/src/components/cards/DownloadingCard.vue b/src/components/cards/DownloadingCard.vue index 124e02a3..2435e185 100644 --- a/src/components/cards/DownloadingCard.vue +++ b/src/components/cards/DownloadingCard.vue @@ -23,6 +23,19 @@ const getSpeedText = () => { // 下载状态 const isDownloading = ref(props.info?.state === "downloading" ? true : false); +// 图片是否加载完成 +const imageLoaded = ref(false); + +// 图片加载完成响应 +const imageLoadHandler = () => { + imageLoaded.value = true; +}; + +// 计算文本类 +const getTextClass = () => { + return imageLoaded.value ? "text-white" : ""; +}; + // 下载状态控制 const toggleDownload = async () => { let operation = isDownloading.value ? "stop" : "start"; @@ -51,41 +64,36 @@ const deleteDownload = async () => {