This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
nezha-nezha-fronted/nezha-fronted/src/components/common/copy.vue

34 lines
637 B
Vue
Raw Normal View History

<template>
<div class="document-copy-block">
<span class="document-copy-text">
<slot name="copy-text"></slot>
</span>
2022-10-20 16:38:11 +08:00
<i v-if="showInfo" class="nz-icon nz-icon-override" style="visibility: hidden" @click="onCopy(copyData)" :title="$t('overall.copyText')"></i>
</div>
</template>
<script>
export default {
name: 'copy',
props: {
2022-10-20 16:38:11 +08:00
copyData: String,
showInfo: String
},
data () {
return {
}
},
methods: {
onCopy (txt) {
this.$copyText(txt).then(() => {
this.$message.success({ message: this.$t('overall.copySuccess') })
})
}
}
}
</script>
<style>
</style>