Commit da66aead by cherishsince

【增加】增加对话切换

parent f14032d6
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<div> <div>
<el-text class="mx-1" size="small" tag="b">置顶</el-text> <el-text class="mx-1" size="small" tag="b">置顶</el-text>
</div> </div>
<el-row v-for="conversation in conversationList" :key="conversation.id"> <el-row v-for="conversation in conversationList" :key="conversation.id" @click="handleConversationClick(conversation.id)">
<div <div
:class="conversation.id === conversationId ? 'conversation active' : 'conversation'" :class="conversation.id === conversationId ? 'conversation active' : 'conversation'"
@click="changeConversation(conversation.id)" @click="changeConversation(conversation.id)"
...@@ -528,6 +528,15 @@ const getChatConversationList = async () => { ...@@ -528,6 +528,15 @@ const getChatConversationList = async () => {
} }
} }
// 对话点击
const handleConversationClick = async (id: number) => {
// 切换对话
conversationId.value = id
console.log('conversationId.value', conversationId.value)
// 获取列表数据
await messageList()
}
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
// 设置当前对话 // 设置当前对话
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment