【解决todo】Ai Chat 增加回到顶部

This commit is contained in:
cherishsince 2024-05-21 16:09:33 +08:00
parent e3bc50e4fc
commit 15e7a260bf

View File

@ -25,7 +25,7 @@
<el-button> <el-button>
<Icon icon="ep:download"/> <Icon icon="ep:download"/>
</el-button> </el-button>
<el-button> <el-button @click="handlerGoTop">
<Icon icon="ep:arrow-up"/> <Icon icon="ep:arrow-up"/>
</el-button> </el-button>
</div> </div>
@ -36,7 +36,10 @@
<div > <div >
<div class="message-container" > <div class="message-container" >
<MessageLoading v-if="listLoading" /> <MessageLoading v-if="listLoading" />
<Message v-if="!listLoading && list.length > 0" ref="messageRef" :list="list" @on-delete-success="handlerMessageDelete" /> <Message v-if="!listLoading && list.length > 0"
ref="messageRef"
:list="list"
@on-delete-success="handlerMessageDelete" />
<ChatEmpty v-if="!listLoading && list.length === 0" @on-prompt="doSend"/> <ChatEmpty v-if="!listLoading && list.length === 0" @on-prompt="doSend"/>
</div> </div>
</div> </div>
@ -444,11 +447,22 @@ const getConversation = async (id: string | null) => {
// ============ message =========== // ============ message ===========
/**
* 删除 message
*/
const handlerMessageDelete = async () => { const handlerMessageDelete = async () => {
// message // message
await getMessageList() await getMessageList()
} }
/**
* 回到顶部
*/
const handlerGoTop = async () => {
await messageRef.value.handlerGoTop()
}
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
// TODO conversationId // TODO conversationId