mirror of
https://github.com/yangzongzhuan/RuoYi-Vue3.git
synced 2025-12-17 15:05:57 +00:00
优化表单构建关闭页签销毁复制插件
This commit is contained in:
@@ -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()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang='scss'>
|
||||
|
||||
Reference in New Issue
Block a user