src/components/chat/hooks/useScrollToBottom.ts
@@ -13,10 +13,15 @@ const scrollToBottom = () => { nextTick(() => { if (chatListDom.value.scrollHeight > chatListDom.value.clientHeight) { chatListDom.value.scrollTop = chatListDom.value.scrollHeight - chatListDom.value.clientHeight; } }); }; const scrollToTop = () => { nextTick(() => { chatListDom.value.scrollTop = 0; }); }; const debounceAmisScroll = debounce(({ instance }) => { @@ -35,5 +40,6 @@ return { scrollToBottom, scrollToTop, }; };