From 67d2d3cee7ac72cd23071dd3101ff92a5f1a5f2f Mon Sep 17 00:00:00 2001 From: hongxilin <17663930442@163.com> Date: Thu, 27 Mar 2025 17:56:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=80=E4=B8=8B=E6=BB=9A?= =?UTF-8?q?=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/homePage.vue | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/views/homePage.vue b/src/views/homePage.vue index 3eeb31e..609d460 100644 --- a/src/views/homePage.vue +++ b/src/views/homePage.vue @@ -224,11 +224,13 @@ watch( watch( activeTab, async () => { - // console.log('activeTab变化了', activeTab.value) - isScrolling.value = false; //回复滚动到底部方法 - setTimeout(() => { - throttledSmoothScrollToBottom(); - }, 100) + console.log('activeTab变化了', activeTab.value) + if (activeTab.value === 'AIchat') { + isScrolling.value = false; //回复滚动到底部方法 + setTimeout(() => { + throttledSmoothScrollToBottom(); + }, 100) + } // setTimeout(throttledSmoothScrollToBottom, 100); }, { deep: true, immediate: true } @@ -436,8 +438,11 @@ onMounted(async () => { !isPhone && localStorage.setItem('localToken', decodeURIComponent(String(getQueryVariable('token')))) setHeight(document.getElementById("testId")); // 给父组件发送窗口高度 + // 获取次数 await chatStore.getUserCount(); + // 滚动到底部 throttledSmoothScrollToBottom(); + // 监听页面高度 throttledHeightListener(); // 添加输入框焦点处理