maxiaoxiao 10 ay önce
ebeveyn
işleme
9a59de0054
1 değiştirilmiş dosya ile 12 ekleme ve 1 silme
  1. 12 1
      src/views/aiModel/index.vue

+ 12 - 1
src/views/aiModel/index.vue

@@ -3,7 +3,7 @@
     <div class="counsel-header">
       <span>会话<i class="ai el-icon-chat-dot-round"></i></span>
     </div>
-    <div class="counsel-chats">
+    <div class="counsel-chats" ref="scrollContainer" @scroll="handleScroll">
       <div class="counsel-left flex">
         <div class="header-img">
           <img src="/static/images/aiModel/kefu.png" />
@@ -264,6 +264,17 @@ export default {
         this.$emit("close");
       }
     },
+    handleScroll(event) {
+      const { scrollTop, scrollHeight, clientHeight } = event.target;
+      // 检查是否滚动到底部
+      if (scrollTop + clientHeight >= scrollHeight) {
+        // 滚动到最底部时的逻辑处理
+        console.log("已滚动到最底部");
+      }
+    },
+    scrollToBottom() {
+      this.$refs.scroll.scrollTop = this.$refs.scroll.scrollHeight;
+    },
   },
 };
 </script>