From d2b43325890dfb1ffe51cd3bc11a684333015dc5 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Thu, 4 Dec 2025 13:03:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=A1=A8=E5=8D=95=E6=9E=84?= =?UTF-8?q?=E5=BB=BA=E5=85=B3=E9=97=AD=E9=A1=B5=E7=AD=BE=E9=94=80=E6=AF=81?= =?UTF-8?q?=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 --- src/views/tool/build/index.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/views/tool/build/index.vue b/src/views/tool/build/index.vue index 870d3d3..9696dc1 100644 --- a/src/views/tool/build/index.vue +++ b/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() +})