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
|
oldActiveId = val
|
||||||
}, { immediate: true })
|
}, { immediate: true })
|
||||||
|
|
||||||
|
let clipboard = null
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
const clipboard = new ClipboardJS('#copyNode', {
|
clipboard = new ClipboardJS('#copyNode', {
|
||||||
text: trigger => {
|
text: trigger => {
|
||||||
const codeStr = generateCode()
|
const codeStr = generateCode()
|
||||||
ElNotification({ title: '成功', message: '代码已复制到剪切板,可粘贴。', type: 'success' })
|
ElNotification({ title: '成功', message: '代码已复制到剪切板,可粘贴。', type: 'success' })
|
||||||
@@ -307,6 +308,9 @@ onMounted(() => {
|
|||||||
proxy.$modal.msgError('代码复制失败')
|
proxy.$modal.msgError('代码复制失败')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
onUnmounted(() => {
|
||||||
|
clipboard.destroy()
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang='scss'>
|
<style lang='scss'>
|
||||||
|
|||||||
Reference in New Issue
Block a user