|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
- <span class="copy" v-if="$slots.default || text">
|
|
|
+ <span class="copy" v-if="textContent">
|
|
|
<slot/>{{text}}
|
|
|
- <i v-if="!!text" @click="copyText" title="复制" class="el-icon-document-copy"></i>
|
|
|
+ <i v-if="!!textContent" @click="copyText" title="复制" class="el-icon-document-copy"></i>
|
|
|
</span>
|
|
|
</template>
|
|
|
|
|
@@ -20,6 +20,11 @@ export default {
|
|
|
default: true
|
|
|
}
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ textContent() {
|
|
|
+ return this.$slots.default || this.text
|
|
|
+ }
|
|
|
+ },
|
|
|
methods: {
|
|
|
copyText() {
|
|
|
const slot = this.$slots.default || []
|