diff --git a/frondend/src/components/PinnedNotice.vue b/frondend/src/components/PinnedNotice.vue index 41472bd..eede1d8 100644 --- a/frondend/src/components/PinnedNotice.vue +++ b/frondend/src/components/PinnedNotice.vue @@ -74,8 +74,14 @@ watch( ) function onVisibility() { - if (document.visibilityState === 'visible') schedule() - else clearTimer() + if (document.visibilityState === 'visible') { + // 回到前台时重新测量:后台期间可能发生过尺寸变化(横竖屏切换、 + // 系统字体缩放等),若沿用旧的 overflow,长文本的滚动距离会算错, + // 出现「还没滚完就翻页」或「滚过头留白」。 + void measure().then(schedule) + } else { + clearTimer() + } } function openAll() {