Bläddra i källkod

优化表单构建关闭页签销毁复制插件

RuoYi 5 månader sedan
förälder
incheckning
bd66cc7260
1 ändrade filer med 5 tillägg och 1 borttagningar
  1. 5 1
      ruoyi-ui/src/views/tool/build/index.vue

+ 5 - 1
ruoyi-ui/src/views/tool/build/index.vue

@@ -153,6 +153,7 @@ import DraggableItem from './DraggableItem'
 
 
 let oldActiveId
 let oldActiveId
 let tempActiveData
 let tempActiveData
+let clipboard = null
 
 
 export default {
 export default {
   components: {
   components: {
@@ -211,7 +212,7 @@ export default {
     }
     }
   },
   },
   mounted() {
   mounted() {
-    const clipboard = new ClipboardJS('#copyNode', {
+    clipboard = new ClipboardJS('#copyNode', {
       text: trigger => {
       text: trigger => {
         const codeStr = this.generateCode()
         const codeStr = this.generateCode()
         this.$notify({
         this.$notify({
@@ -226,6 +227,9 @@ export default {
       this.$message.error('代码复制失败')
       this.$message.error('代码复制失败')
     })
     })
   },
   },
+  beforeDestroy() {
+    clipboard.destroy()
+  },
   methods: {
   methods: {
     activeFormItem(element) {
     activeFormItem(element) {
       this.activeData = element
       this.activeData = element