【增加】增加对话切换
parent
f14032d69d
commit
da66aead54
|
@ -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 () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 对话点击
|
||||||
|
const handleConversationClick = async (id: number) => {
|
||||||
|
// 切换对话
|
||||||
|
conversationId.value = id
|
||||||
|
console.log('conversationId.value', conversationId.value)
|
||||||
|
// 获取列表数据
|
||||||
|
await messageList()
|
||||||
|
}
|
||||||
|
|
||||||
/** 初始化 **/
|
/** 初始化 **/
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
// 设置当前对话
|
// 设置当前对话
|
||||||
|
|
Loading…
Reference in New Issue