From bebf1e7ae3b5372de72cc82aded87c183e107f86 Mon Sep 17 00:00:00 2001 From: cherishsince Date: Fri, 24 May 2024 10:35:11 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E8=A7=A3=E5=86=B3todo=E3=80=91Chat=20?= =?UTF-8?q?=E8=81=8A=E5=A4=A9=EF=BC=8C=E6=96=B0=E5=BB=BA=E5=AF=B9=E8=AF=9D?= =?UTF-8?q?=E6=B8=85=E7=A9=BA=E8=BE=93=E5=85=A5=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/ai/chat/Conversation.vue | 9 ++++++++- src/views/ai/chat/index.vue | 9 +++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/views/ai/chat/Conversation.vue b/src/views/ai/chat/Conversation.vue index f735252c..946735f7 100644 --- a/src/views/ai/chat/Conversation.vue +++ b/src/views/ai/chat/Conversation.vue @@ -122,7 +122,12 @@ const props = defineProps({ }) // 定义钩子 -const emits = defineEmits(['onConversationClick', 'onConversationClear', 'onConversationDelete']) +const emits = defineEmits([ + 'onConversationCreate', + 'onConversationClick', + 'onConversationClear', + 'onConversationDelete' +]) /** * 对话 - 搜索 @@ -256,6 +261,8 @@ const createConversation = async () => { await getChatConversationList() // 3、选中对话 await handleConversationClick(conversationId) + // 4、回调 + emits('onConversationCreate') } /** diff --git a/src/views/ai/chat/index.vue b/src/views/ai/chat/index.vue index ac97e1ec..d9a44df1 100644 --- a/src/views/ai/chat/index.vue +++ b/src/views/ai/chat/index.vue @@ -3,6 +3,7 @@ { await getConversation(activeConversationId.value) } +/** + * 对话 - 创建 + */ +const handleConversationCreate = async () => { + // 创建新的对话,清空输入框 + prompt.value = '' +} + /** * 对话 - 点击 */