From 6e11f03a120293aab2fe5b01471f17bc68cde244 Mon Sep 17 00:00:00 2001 From: Lan Date: Sun, 9 Mar 2025 22:45:01 +0800 Subject: [PATCH] fix:https://github.com/vastsa/FileCodeBox/issues/272 --- src/views/RetrievewFileView.vue | 35 +++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/src/views/RetrievewFileView.vue b/src/views/RetrievewFileView.vue index 26e99b7..14fd7bc 100644 --- a/src/views/RetrievewFileView.vue +++ b/src/views/RetrievewFileView.vue @@ -209,8 +209,6 @@ - -
内容预览 - +
+ + +
+ @@ -244,7 +255,8 @@ import { FileIcon, CalendarIcon, HardDriveIcon, - DownloadIcon + DownloadIcon, + CopyIcon } from 'lucide-vue-next' import { useRouter, useRoute } from 'vue-router' import QRCode from 'qrcode.vue' @@ -289,6 +301,17 @@ watch(code, (newVal) => { } }) +// 在其他代码后添加复制功能 +const copyContent = async () => { + if (selectedRecord.value && selectedRecord.value.content) { + try { + await navigator.clipboard.writeText(selectedRecord.value.content) + alertStore.showAlert('内容已复制到剪贴板', 'success') + } catch (err) { + alertStore.showAlert('复制失败,请重试', 'error') + } + } +} const handleSubmit = async () => { if (code.value.length !== 5) { alertStore.showAlert('请输入5位取件码', 'error')