From 05e714ef77c06a35386dd2c08bb78e52e2f0fcee Mon Sep 17 00:00:00 2001 From: Julian Freeman Date: Sun, 7 Dec 2025 20:47:23 -0400 Subject: [PATCH] check page, keep scrollbar pos --- src/App.vue | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/App.vue b/src/App.vue index 72f8d04..64fa610 100644 --- a/src/App.vue +++ b/src/App.vue @@ -42,10 +42,25 @@ const currentHistoryKey = ref(""); // Check Data const checkLogs = ref([]); const logContainerRef = ref(null); +const checkPageScrollTop = ref(0); // Lifecycle let unlistenDrop: UnlistenFn | null = null; +const handleLogScroll = (e: Event) => { + const target = e.target as HTMLElement; + checkPageScrollTop.value = target.scrollTop; +} + +watch(activeMenu, async (newVal) => { + if (newVal === 'check') { + await nextTick(); + if (logContainerRef.value) { + logContainerRef.value.scrollTop = checkPageScrollTop.value; + } + } +}); + onMounted(async () => { // Theme init const savedTheme = localStorage.getItem('theme'); @@ -563,7 +578,7 @@ watch(currentDir, (newPath) => {
日志输出
-
+
{{ log }}