diff --git a/Yi.Ai.Vue3/src/pages/chat/layouts/chatWithId/index.vue b/Yi.Ai.Vue3/src/pages/chat/layouts/chatWithId/index.vue index f1e70486..9c708d3f 100644 --- a/Yi.Ai.Vue3/src/pages/chat/layouts/chatWithId/index.vue +++ b/Yi.Ai.Vue3/src/pages/chat/layouts/chatWithId/index.vue @@ -268,6 +268,14 @@ watch( function markdownContent(item: any) { return item.content; } + +// 复制 +function copy(item: any) { + console.log('复制', item); + navigator.clipboard.writeText(item.content || '') + .then(() => ElMessage.success('已复制到剪贴板')) + .catch(() => ElMessage.error('复制失败')); +}