From c89d1d1fe4e820bc9d1a942467a3f1e017b40dac Mon Sep 17 00:00:00 2001 From: wujingjing <gersonwu@qq.com> Date: 星期三, 06 十一月 2024 16:33:36 +0800 Subject: [PATCH] 无关代码删除 --- src/components/chat/hooks/useScrollToBottom.ts | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/components/chat/hooks/useScrollToBottom.ts b/src/components/chat/hooks/useScrollToBottom.ts index f7484b2..66a344d 100644 --- a/src/components/chat/hooks/useScrollToBottom.ts +++ b/src/components/chat/hooks/useScrollToBottom.ts @@ -13,11 +13,9 @@ const scrollToBottom = () => { nextTick(() => { - if (!chatListDom.value) return; - const parent = chatListDom.value.parentElement; - if (!parent) return; - if (parent.scrollHeight > parent.clientHeight) { - parent.scrollTop = parent.scrollHeight - parent.clientHeight; + + if (chatListDom.value.scrollHeight > chatListDom.value.clientHeight) { + chatListDom.value.scrollTop = chatListDom.value.scrollHeight - chatListDom.value.clientHeight; } }); }; -- Gitblit v1.9.3