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 = '' +} + /** * 对话 - 点击 */