Skip to content

Commit 2098910

Browse files
committed
feat: add copy_cipher button
1 parent f09a355 commit 2098910

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

pages/decrypt/upload.vue

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414
/>
1515
<div style="margin: 20px;" />
1616
<el-button type="primary" @click="get_cipher">获取密文</el-button>
17-
<div style="margin: 10px;" />
18-
<el-text class="mx-1" style="margin: 5px;">密文:{{ cipher }}</el-text>
17+
<el-button v-if="cipher" type="primary" @click="copy_cipher">复制密文</el-button>
18+
<!-- <div style="margin: 10px;" /> -->
19+
<!-- <el-text class="mx-1" style="margin: 5px;">密文:{{ cipher }}</el-text> -->
1920
<div style="margin: 10px;" />
2021
<el-text class="mx-1" style="margin: 5px;">Share</el-text>
2122
<el-input
@@ -113,6 +114,15 @@ async function get_cipher() {
113114
}
114115
}
115116
117+
function copy_cipher() {
118+
navigator.clipboard.writeText(cipher.value)
119+
ElNotification({
120+
title: '复制成功',
121+
position: 'bottom-right',
122+
type: 'success'
123+
})
124+
}
125+
116126
const handleUpload = (file) => {
117127
const reader = new FileReader()
118128
reader.onload = (e) => {

0 commit comments

Comments
 (0)