From 954085666a529326c73dd6ccb2292317fbd3583c Mon Sep 17 00:00:00 2001 From: insistence <3055204202@qq.com> Date: Fri, 19 Dec 2025 09:02:58 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E6=9E=84=E5=BB=BA=E5=85=B3=E9=97=AD=E9=A1=B5=E7=AD=BE=E9=94=80?= =?UTF-8?q?=E6=AF=81=E5=A4=8D=E5=88=B6=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-fastapi-frontend/src/views/tool/build/index.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ruoyi-fastapi-frontend/src/views/tool/build/index.vue b/ruoyi-fastapi-frontend/src/views/tool/build/index.vue index 870d3d3..9696dc1 100755 --- a/ruoyi-fastapi-frontend/src/views/tool/build/index.vue +++ b/ruoyi-fastapi-frontend/src/views/tool/build/index.vue @@ -295,8 +295,9 @@ watch(activeId, (val) => { oldActiveId = val }, { immediate: true }) +let clipboard = null onMounted(() => { - const clipboard = new ClipboardJS('#copyNode', { + clipboard = new ClipboardJS('#copyNode', { text: trigger => { const codeStr = generateCode() ElNotification({ title: '成功', message: '代码已复制到剪切板,可粘贴。', type: 'success' }) @@ -307,6 +308,9 @@ onMounted(() => { proxy.$modal.msgError('代码复制失败') }) }) +onUnmounted(() => { + clipboard.destroy() +})