yangyin
2024-11-08 f41e52e3debf30558d556dc0451776f5422fb9b8
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,
   };
};