From 346b6f8d306aba92d45ac7ce6ee31be3d38662ad Mon Sep 17 00:00:00 2001
From: wujingjing <gersonwu@qq.com>
Date: 星期二, 05 十一月 2024 16:25:10 +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