perf: 删除历史记录

This commit is contained in:
rd
2025-09-01 09:33:13 +08:00
parent f9bc0e0187
commit e0aaa74d4f
4 changed files with 15 additions and 10 deletions

View File

@ -82,6 +82,12 @@ export default {
const { id } = item;
handleUserHome({ conversationId: id });
};
const onDeleteConversation = (id) => {
const index = dataSource.value.findIndex((item) => item.id === id);
if (index === -1) return;
dataSource.value.splice(index, 1);
}
expose({
showDrawer,
@ -107,7 +113,7 @@ export default {
</section>
)}
<DeleteChatModal ref={deleteChatModalRef} />
<DeleteChatModal ref={deleteChatModalRef} onDelete={onDeleteConversation}/>
</Drawer>
);
},