From 5e8b3e27c4a847be602e97bcd586ab6627108484 Mon Sep 17 00:00:00 2001 From: yangyin <1850366751@qq.com> Date: 星期一, 04 十一月 2024 11:16:35 +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