From 7866aa30bd13dab1fc0662e1baf6675d0dc1b282 Mon Sep 17 00:00:00 2001 From: wujingjing <gersonwu@qq.com> Date: 星期三, 02 四月 2025 15:42:30 +0800 Subject: [PATCH] 修改意见 --- src/components/chat/hooks/useScroll.ts | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/components/chat/hooks/useScroll.ts b/src/components/chat/hooks/useScroll.ts index c7f78b1..8e55dfc 100644 --- a/src/components/chat/hooks/useScroll.ts +++ b/src/components/chat/hooks/useScroll.ts @@ -10,11 +10,19 @@ export const useScroll = (option: UseScrollOption) => { const { chatListDom } = option; - + const scrollStepToBottom = () => { + const allStepList = document.querySelectorAll('.step-list'); + const lastStepList = allStepList[allStepList.length - 1]; + if (!lastStepList) return; + lastStepList.scrollTop = lastStepList.scrollHeight - lastStepList.clientHeight; + }; const scrollToBottom = () => { nextTick(() => { if (chatListDom.value.scrollHeight > chatListDom.value.clientHeight) { chatListDom.value.scrollTop = chatListDom.value.scrollHeight - chatListDom.value.clientHeight; + nextTick(() => { + scrollStepToBottom(); + }); } }); }; @@ -24,7 +32,6 @@ chatListDom.value.scrollTop = 0; }); }; - const checkIsBottom = () => { // 璇樊 2鍍忕礌 -- Gitblit v1.9.3