From d9c6cec16ec6583f3677eb7139712c7e8ddd06ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B3=E5=85=83=E7=9A=93?= Date: Sun, 18 May 2025 23:46:14 +0800 Subject: [PATCH] Made the animation working again :) --- components/app/windows/aboutNewsOrg.vue | 26 ++++++++++++++++++------- components/app/windows/sources.vue | 4 ++-- docker-compose.yml | 11 ++++++++--- 3 files changed, 29 insertions(+), 12 deletions(-) diff --git a/components/app/windows/aboutNewsOrg.vue b/components/app/windows/aboutNewsOrg.vue index bb4c068..f0515ae 100644 --- a/components/app/windows/aboutNewsOrg.vue +++ b/components/app/windows/aboutNewsOrg.vue @@ -33,12 +33,21 @@ const { const orgNameAnimation = ref(null); -onMounted(() => { - gsap.to(orgNameAnimation.value, { - duration: 1, - scrambleText: fetchNewsOrgInfo.value?.title, - }); -}); +watch( + () => fetchNewsOrgInfo.value, + (newValue) => { + if (newValue?.title) { + nextTick(() => { + gsap.to(orgNameAnimation.value, { + duration: 1, + scrambleText: newValue.title, + ease: "none", + }); + }); + } + }, + { immediate: true }, +);