From 91ffacc3358886c785cd23bb5f940b0ed9b48437 Mon Sep 17 00:00:00 2001 From: Tim Date: Wed, 20 Aug 2025 19:43:31 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=B7=B2=E7=BB=8F=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E7=9A=84=E5=B8=96=E5=AD=90=20=E9=87=8D=E6=96=B0=E8=BF=9B?= =?UTF-8?q?=E5=85=A5=20=E6=B2=A1=E6=9C=89=E6=89=A7=E8=A1=8C=E8=AF=84?= =?UTF-8?q?=E8=AE=BA=E5=AE=9A=E4=BD=8D=E9=80=BB=E8=BE=91=20#652?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend_nuxt/pages/posts/[id]/index.vue | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/frontend_nuxt/pages/posts/[id]/index.vue b/frontend_nuxt/pages/posts/[id]/index.vue index b117e6e20..45f4e9bbe 100644 --- a/frontend_nuxt/pages/posts/[id]/index.vue +++ b/frontend_nuxt/pages/posts/[id]/index.vue @@ -876,12 +876,7 @@ const gotoProfile = () => { navigateTo(`/users/${author.value.id}`, { replace: true }) } -onActivated(async () => { - await refreshPost() - await fetchComments() -}) - -onMounted(async () => { +const initPage = async () => { await fetchComments() const hash = location.hash const id = hash.startsWith('#comment-') ? hash.substring('#comment-'.length) : null @@ -889,6 +884,14 @@ onMounted(async () => { updateCurrentIndex() window.addEventListener('scroll', updateCurrentIndex) jumpToHashComment() +} + +onActivated(async () => { + await initPage() +}) + +onMounted(async () => { + await initPage() })