perf : issue 、recordRule 页面复制功能组件化
This commit is contained in:
32
nezha-fronted/src/components/common/copy.vue
Normal file
32
nezha-fronted/src/components/common/copy.vue
Normal file
@@ -0,0 +1,32 @@
|
||||
<template>
|
||||
<div class="document-copy-block">
|
||||
<span class="document-copy-text">
|
||||
<slot name="copy-text"></slot>
|
||||
</span>
|
||||
<i v-if="copyData" 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: {
|
||||
copyData: String
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onCopy (txt) {
|
||||
this.$copyText(txt).then(() => {
|
||||
this.$message.success({ message: this.$t('overall.copySuccess') })
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user