From a742e6ae7e6db5fe12179ca2e5d000043cdff258 Mon Sep 17 00:00:00 2001 From: Twilight Date: Wed, 18 Sep 2024 16:13:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20=E5=86=8D=E6=AC=A1?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E5=8F=96=E6=B6=88=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/AssistantMenu.vue | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/components/AssistantMenu.vue b/src/components/AssistantMenu.vue index 5e6c294..d576412 100644 --- a/src/components/AssistantMenu.vue +++ b/src/components/AssistantMenu.vue @@ -51,6 +51,13 @@ function update() { } const changeAssistant = (id: number | undefined) => { + + // 如果 id 相同,则取消选择 + if (id === chatStore.currentAssistantId) { + chatStore.currentAssistantId = 0; + return; + } + if (id) { chatStore.currentAssistantId = id; }