From 8241bcbbb4031e00b02b780bcbd1b40cf27b5eac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A1=97=E8=A7=92=E5=B0=8F=E6=9E=97?= <1013335014@qq.com> Date: Fri, 19 Jan 2024 17:45:48 +0800 Subject: [PATCH] =?UTF-8?q?Demo=EF=BC=9A=E4=BC=98=E5=8C=96=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/pages/Edit/components/Edit.vue | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/web/src/pages/Edit/components/Edit.vue b/web/src/pages/Edit/components/Edit.vue index 78d550c4..6b23fc77 100644 --- a/web/src/pages/Edit/components/Edit.vue +++ b/web/src/pages/Edit/components/Edit.vue @@ -570,15 +570,23 @@ export default { // 加载手绘风格插件 addHandDrawnLikeStylePlugin() { - if (!this.mindMap) return - this.mindMap.addPlugin(HandDrawnLikeStyle) - this.mindMap.reRender() + try { + if (!this.mindMap) return + this.mindMap.addPlugin(HandDrawnLikeStyle) + this.mindMap.reRender() + } catch (error) { + console.log('手绘风格插件不存在') + } }, // 移除手绘风格插件 removeHandDrawnLikeStylePlugin() { - this.mindMap.removePlugin(HandDrawnLikeStyle) - this.mindMap.reRender() + try { + this.mindMap.removePlugin(HandDrawnLikeStyle) + this.mindMap.reRender() + } catch (error) { + console.log('手绘风格插件不存在') + } }, // 测试动态插入节点