修复Footer组件中复制文本无提示的问题

This commit is contained in:
2024-08-29 13:02:45 +08:00
parent 799a0cf43f
commit ffa70824e9

View File

@@ -1,17 +1,12 @@
<script setup lang="ts"> <script setup lang="ts">
import copyText from '@/lib/copyText'; import copyText from '@/lib/copyText';
import { ElMessage } from 'element-plus'
let copyTextwithMsg = (text : string) => { let copyTextwithMsg = (text : string) => {
if(copyText(text)){ if(copyText(text)){
ElMessage({ ElMessage.success('复制成功')
message: '复制成功',
type: 'success',
})
}else{ }else{
ElMessage({ ElMessage.error('复制失败')
message: '复制失败',
type: 'error',
})
} }
} }
</script> </script>
@@ -58,9 +53,9 @@ let copyTextwithMsg = (text : string) => {
</template> </template>
</el-popover> </el-popover>
<el-popover trigger="click" placement="top" :width="180"> <el-popover trigger="click" placement="top" :width="180">
<p>邮箱号3341154833@qq.com</p> <p>邮箱号tone@ctbu.net.cn</p>
<div style="text-align: center; margin: 0"> <div style="text-align: center; margin: 0">
<el-button size="small" type="primary" @click="copyTextwithMsg('3341154833@qq.com')">复制</el-button> <el-button size="small" type="primary" @click="copyTextwithMsg('tone@ctbu.net.cn')">复制</el-button>
</div> </div>
<template #reference> <template #reference>
<div class="icon"> <div class="icon">
@@ -73,7 +68,7 @@ let copyTextwithMsg = (text : string) => {
</div> </div>
</template> </template>
</el-popover> </el-popover>
<a class="icon" href="https://github.com/tonecn"> <a class="icon" href="https://github.com/tonecn" target="_blank">
<svg t="1705909977594" class="icon" viewBox="0 0 1024 1024" version="1.1" <svg t="1705909977594" class="icon" viewBox="0 0 1024 1024" version="1.1"
xmlns="http://www.w3.org/2000/svg" p-id="9342" width="24" height="24"> xmlns="http://www.w3.org/2000/svg" p-id="9342" width="24" height="24">
<path <path