perf: 删除历史记录
This commit is contained in:
@ -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>
|
||||
);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user