Skip to content

Commit

Permalink
feat: add copy_cipher button
Browse files Browse the repository at this point in the history
  • Loading branch information
Zecyel committed Oct 8, 2024
1 parent f09a355 commit 2098910
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions pages/decrypt/upload.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
/>
<div style="margin: 20px;" />
<el-button type="primary" @click="get_cipher">获取密文</el-button>
<div style="margin: 10px;" />
<el-text class="mx-1" style="margin: 5px;">密文:{{ cipher }}</el-text>
<el-button v-if="cipher" type="primary" @click="copy_cipher">复制密文</el-button>
<!-- <div style="margin: 10px;" /> -->
<!-- <el-text class="mx-1" style="margin: 5px;">密文:{{ cipher }}</el-text> -->
<div style="margin: 10px;" />
<el-text class="mx-1" style="margin: 5px;">Share</el-text>
<el-input
Expand Down Expand Up @@ -113,6 +114,15 @@ async function get_cipher() {
}
}
function copy_cipher() {
navigator.clipboard.writeText(cipher.value)
ElNotification({
title: '复制成功',
position: 'bottom-right',
type: 'success'
})
}
const handleUpload = (file) => {
const reader = new FileReader()
reader.onload = (e) => {
Expand Down

0 comments on commit 2098910

Please sign in to comment.