refactor: 优化日志筛选与文本复制

This commit is contained in:
秋帆
2024-04-10 20:49:18 +08:00
parent 6e8048102e
commit 63da55ab03
4 changed files with 44 additions and 8 deletions

View File

@@ -0,0 +1,28 @@
<template>
<div class="content">
<icon-copy :size="16" @click="copyText"/>
</div>
</template>
<script setup lang="ts">
import { Message } from "@arco-design/web-vue"
interface Props{
value:any
}
const props = withDefaults(defineProps<Props>(), {})
const copyText=()=>{
const textarea = document.createElement('textarea')
textarea.value = props.value
document.body.appendChild(textarea)
textarea.select()
document.execCommand('copy')
document.body.removeChild(textarea)
Message.success('复制成功')
}
</script>
<style scoped lang="scss">
.content{
display: inline-block;
margin-left: 5px;
cursor: pointer;
}
</style>