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 }}