Commit 8fb54dbb by cherishsince

【解决todo】Chat 对话默认选中第一个

parent bebf1e7a
...@@ -378,12 +378,17 @@ watch(activeId, async (newValue, oldValue) => { ...@@ -378,12 +378,17 @@ watch(activeId, async (newValue, oldValue) => {
defineExpose({createConversation}) defineExpose({createConversation})
onMounted(async () => { onMounted(async () => {
// 获取 对话列表
await getChatConversationList()
// 默认选中 // 默认选中
if (props.activeId != null) { if (props.activeId != null) {
activeConversationId.value = props.activeId activeConversationId.value = props.activeId
} else {
// 首次默认选中第一个
if (conversationList.value.length) {
activeConversationId.value = conversationList.value[0].id
}
} }
// 获取 对话列表
await getChatConversationList()
}) })
</script> </script>
......
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