From afc3c8d6d8e11736feb4b9bf4fa18113d6130782 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E6=9D=B0?= Date: Tue, 12 Aug 2025 18:01:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B5=8F=E8=A7=88=E5=99=A8?= =?UTF-8?q?=E6=8E=A7=E5=88=B6=E5=8F=B0=E6=8A=A5=E9=94=99=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/homePage.vue | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/views/homePage.vue b/src/views/homePage.vue index 7b63e28..b17b71f 100644 --- a/src/views/homePage.vue +++ b/src/views/homePage.vue @@ -327,10 +327,12 @@ watch( async () => { console.log("activeTab变化了", activeTab.value); if (activeTab.value == "AIchat" || activeTab.value == "AiEmotion") { - historyRecordRef.value.getHistoryList({ - model: activeTab.value == "AIchat" ? 1 : 2, - token: localStorage.getItem("localToken"), - }); + if (historyRecordRef.value && historyRecordRef.value.getHistoryList) { + historyRecordRef.value.getHistoryList({ + model: activeTab.value == "AIchat" ? 1 : 2, + token: localStorage.getItem("localToken"), + }); + } } if (activeTab.value === "AIchat") { @@ -566,7 +568,7 @@ const expandHistory = () => { // model: activeTab.value == "AIchat" ? 1 : 2, // }); // } - if (historyRecordRef) { + if (historyRecordRef.value && historyRecordRef.value.isCollapsed !== undefined) { console.log("存在"); historyRecordRef.value.isCollapsed = !historyRecordRef.value.isCollapsed; }