From beca2f5edc3697d15ebae08c37968c110202477d Mon Sep 17 00:00:00 2001 From: Jiajie Chen Date: Thu, 20 Jun 2024 10:22:32 +0800 Subject: [PATCH] feat: delay scrolling to wait for re-render --- frontend/src/pages/monitor/[hostname].vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/pages/monitor/[hostname].vue b/frontend/src/pages/monitor/[hostname].vue index a3b44ea..2105252 100644 --- a/frontend/src/pages/monitor/[hostname].vue +++ b/frontend/src/pages/monitor/[hostname].vue @@ -30,7 +30,9 @@ export default { this.lines = []; } this.lines.push(ansi_up.ansi_to_html(event.data) + "
"); - window.scrollTo(0, document.body.scrollHeight); + setTimeout(() => { + window.scrollTo(0, document.body.scrollHeight); + }, 100); }; }, },