Преглед на файлове

复制功能弹出两次提示bug处理

sunlupeng преди 1 година
родител
ревизия
05ad51b3ba
променени са 3 файла, в които са добавени 12 реда и са изтрити 6 реда
  1. 2 2
      .env.dev
  2. 5 2
      src/views/system/companyInfo/index.vue
  3. 5 2
      src/views/system/user/index.vue

+ 2 - 2
.env.dev

@@ -8,9 +8,9 @@ VUE_APP_TITLE = 爱思系统
 # 赵培清
 # VUE_APP_BASE_API = 'http://192.168.100.213:48080'
 # 王东坡
-VUE_APP_BASE_API = 'http://192.168.100.64:48081'
+# VUE_APP_BASE_API = 'http://192.168.100.64:48081'
 # 测试
-# VUE_APP_BASE_API = 'http://47.103.79.143:48081'
+VUE_APP_BASE_API = 'http://47.103.79.143:48081'
 
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 5 - 2
src/views/system/companyInfo/index.vue

@@ -77,7 +77,7 @@ export default {
     this.getTenantInfo();
   },
   mounted() {
-    const clipboard = new ClipboardJS('.copy-btn', {
+    this.clipboard = new ClipboardJS('.copy-btn', {
       text: trigger => {
         this.$message({
           message: '复制成功',
@@ -86,7 +86,7 @@ export default {
         return this.tenantData.corpId;
       }
     })
-    clipboard.on('error', e => {
+    this.clipboard.on('error', e => {
       this.$message.error('复制失败')
     })
   },
@@ -109,6 +109,9 @@ export default {
         console.log(this.tenantData);
       })
     },
+  },
+  destroyed() {
+    this.clipboard.destroy()
   }
 };
 </script>

+ 5 - 2
src/views/system/user/index.vue

@@ -188,7 +188,7 @@ export default {
     this.getTreeselect();
   },
   mounted() {
-    const clipboard = new ClipboardJS('.copy-btn', {
+    this.clipboard = new ClipboardJS('.copy-btn', {
       text: trigger => {
         this.$message({
           message: '复制成功',
@@ -197,7 +197,7 @@ export default {
         return this.corpId;
       }
     })
-    clipboard.on('error', e => {
+    this.clipboard.on('error', e => {
       this.$message.error('复制失败')
     })
   },
@@ -307,6 +307,9 @@ export default {
           this.exportLoading = false;
       }).catch(() => {});
     }
+  },
+  destroyed() {
+    this.clipboard.destroy()
   }
 };
 </script>