From 009d139549129bb6f075e590b07880a6b513214d Mon Sep 17 00:00:00 2001 From: Tim Date: Tue, 5 Aug 2025 19:54:43 +0800 Subject: [PATCH] fix: magic bug with magic wait --- frontend/src/views/PostPageView.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/views/PostPageView.vue b/frontend/src/views/PostPageView.vue index 152ad08ac..c4f9107a3 100644 --- a/frontend/src/views/PostPageView.vue +++ b/frontend/src/views/PostPageView.vue @@ -566,7 +566,8 @@ export default { const hash = location.hash if (hash.startsWith('#comment-')) { const id = hash.substring('#comment-'.length) - await nextTick() + // 不清楚啥原因,先wait一下子不然会定不准 😅 + await new Promise(resolve => setTimeout(resolve, 500)) const el = document.getElementById('comment-' + id) if (el) { const top = el.getBoundingClientRect().top + window.scrollY - headerHeight - 20 // 20 for beauty