fix: 增加消息复制、消息时间
This commit is contained in:
@@ -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('复制失败'));
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -284,6 +292,19 @@ function markdownContent(item: any) {
|
||||
<template #content="{ item }">
|
||||
<XMarkdown class="markdown-body" :markdown="markdownContent(item)" />
|
||||
</template>
|
||||
|
||||
<!-- 自定义底部 -->
|
||||
<template #footer="{ item }">
|
||||
<div class="footer-wrapper">
|
||||
<div class="footer-container">
|
||||
<div class="footer-time">
|
||||
{{ item.creationTime }}
|
||||
|
||||
<el-button icon="DocumentCopy" size="small" circle @click="copy(item)" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</BubbleList>
|
||||
|
||||
<Sender
|
||||
|
||||
Reference in New Issue
Block a user