mirror of
				https://gitee.com/hhyykk/ipms-sjy-ui.git
				synced 2025-11-04 20:28:45 +08:00 
			
		
		
		
	【解决todo】Chat 聊天,新建对话清空输入框
This commit is contained in:
		@@ -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')
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 
 | 
			
		||||
@@ -3,6 +3,7 @@
 | 
			
		||||
    <!-- 左侧:会话列表 -->
 | 
			
		||||
    <Conversation :active-id="activeConversationId"
 | 
			
		||||
                  ref="conversationRef"
 | 
			
		||||
                  @onConversationCreate="handleConversationCreate"
 | 
			
		||||
                  @onConversationClick="handleConversationClick"
 | 
			
		||||
                  @onConversationClear="handlerConversationClear"
 | 
			
		||||
                  @onConversationDelete="handlerConversationDelete"
 | 
			
		||||
@@ -440,6 +441,14 @@ const handlerTitleSuccess = async () => {
 | 
			
		||||
  await getConversation(activeConversationId.value)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 对话 - 创建
 | 
			
		||||
 */
 | 
			
		||||
const handleConversationCreate = async () => {
 | 
			
		||||
  // 创建新的对话,清空输入框
 | 
			
		||||
  prompt.value = ''
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 对话 - 点击
 | 
			
		||||
 */
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user