From 9ac16b7ebe88b7e10d0613e7cc6d3f5b1016b600 Mon Sep 17 00:00:00 2001 From: xlsea Date: Wed, 9 Apr 2025 10:04:45 +0800 Subject: [PATCH] =?UTF-8?q?style(1.5.0)-beta1):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E7=BB=84=E4=BB=B6=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/log-drawer.vue | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/components/common/log-drawer.vue b/src/components/common/log-drawer.vue index bc22ce3..6bfc61b 100644 --- a/src/components/common/log-drawer.vue +++ b/src/components/common/log-drawer.vue @@ -256,6 +256,9 @@ watch( const data = JSON.parse(e.data) as Api.JobLog.JobMessage; data.key = `${data.time_stamp}-${generateRandomString(16)}`; logList.value.push(data); + nextTick(() => { + if (isAutoScroll.value) virtualListInst.value?.scrollTo({ position: 'bottom', debounce: true }); + }); } else { finished.value = true; stopLogByWs(); @@ -268,7 +271,8 @@ watch( await getLogList(); } - } + }, + { immediate: true } ); function timestampToDate(timestamp: string): string { @@ -489,7 +493,13 @@ const SnailLogComponent = defineComponent({ 日志正在加载 {{ title }} - +