Prechádzať zdrojové kódy

fix copy empty status bug

wolyshaw 4 rokov pred
rodič
commit
ec1319bd1b
1 zmenil súbory, kde vykonal 5 pridanie a 3 odobranie
  1. 5 3
      src/components/copy-text/index.vue

+ 5 - 3
src/components/copy-text/index.vue

@@ -22,13 +22,15 @@ export default {
   },
   computed: {
     textContent() {
-      return this.$slots.default || this.text
+      const slot = this.$slots.default || []
+      const text = slot[0]?.text || this.text
+      console.log(text)
+      return text
     }
   },
   methods: {
     copyText() {
-      const slot = this.$slots.default || []
-      const text = slot[0]?.text || this.text
+      const text = this.textContent
       if (text) {
         copy(text)
         if (this.hint) {