From 520244eea9a6962a94b05a50916c2f8fda03cc99 Mon Sep 17 00:00:00 2001 From: cherishsince Date: Wed, 5 Jun 2024 13:54:36 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=A2=9E=E5=8A=A0=E3=80=91Image=20?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E7=BB=84=E4=BB=B6=E5=8F=96=E6=B6=88=E6=8C=82?= =?UTF-8?q?=E5=9C=A8=20=E9=94=80=E6=AF=81=E5=AE=9A=E6=97=B6=E5=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/ai/image/ImageTask.vue | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/views/ai/image/ImageTask.vue b/src/views/ai/image/ImageTask.vue index 31a947b6..d109a22c 100644 --- a/src/views/ai/image/ImageTask.vue +++ b/src/views/ai/image/ImageTask.vue @@ -87,9 +87,10 @@ const downloadImage = async (imageUrl) => { } } -// +/** 暴露组件方法 */ defineExpose({getImageList}) -// + +/** 组件挂在的时候 */ onMounted(async () => { // 获取 image 列表 await getImageList() @@ -98,9 +99,12 @@ onMounted(async () => { await getImageList() }, 1000 * 20) }) -// -onUnmounted(async () => { +/** 组件取消挂在的时候 */ +onUnmounted(async () => { + if (imageListInterval.value) { + clearInterval(imageListInterval.value) + } })