From 1c4dbb1e46a25bb8e1b824cd5d580ce616316b28 Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: Thu, 04 Dec 2025 13:15:50 +0800
Subject: [PATCH] 优化表单构建关闭页签销毁复制插件

---
 ruoyi-ui/src/views/tool/build/index.vue |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/ruoyi-ui/src/views/tool/build/index.vue b/ruoyi-ui/src/views/tool/build/index.vue
index 9e9e940..26c7eec 100644
--- a/ruoyi-ui/src/views/tool/build/index.vue
+++ b/ruoyi-ui/src/views/tool/build/index.vue
@@ -153,6 +153,7 @@
 
 let oldActiveId
 let tempActiveData
+let clipboard = null
 
 export default {
   components: {
@@ -211,7 +212,7 @@
     }
   },
   mounted() {
-    const clipboard = new ClipboardJS('#copyNode', {
+    clipboard = new ClipboardJS('#copyNode', {
       text: trigger => {
         const codeStr = this.generateCode()
         this.$notify({
@@ -226,6 +227,9 @@
       this.$message.error('代码复制失败')
     })
   },
+  beforeDestroy() {
+    clipboard.destroy()
+  },
   methods: {
     activeFormItem(element) {
       this.activeData = element

--
Gitblit v1.9.3