Skip to content

Commit 74b62bf

Browse files
committed
【功能完善】文件列表: 添加复制链接功能
1 parent 472da92 commit 74b62bf

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/views/infra/file/index.vue

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,13 @@
9595
/>
9696
<el-table-column label="操作" align="center">
9797
<template #default="scope">
98+
<el-button
99+
link
100+
type="primary"
101+
@click="copyToClipboard(scope.row.url)"
102+
>
103+
复制链接
104+
</el-button>
98105
<el-button
99106
link
100107
type="danger"
@@ -172,6 +179,13 @@ const openForm = () => {
172179
formRef.value.open()
173180
}
174181
182+
/** 复制到剪贴板方法 */
183+
const copyToClipboard = (text: string) => {
184+
navigator.clipboard.writeText(text).then(() => {
185+
message.success('复制成功')
186+
})
187+
}
188+
175189
/** 删除按钮操作 */
176190
const handleDelete = async (id: number) => {
177191
try {

0 commit comments

Comments
 (0)