From 9661aa55c5c83d44f74cf1ec76868d9920a756a7 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: Wed, 2 Apr 2025 09:44:42 +0800 Subject: [PATCH] =?UTF-8?q?Feat=EF=BC=9A=E6=8F=92=E4=BB=B6=E6=96=B0?= =?UTF-8?q?=E5=A2=9Epreload=E9=85=8D=E7=BD=AE=EF=BC=8C=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E5=9C=A8=E6=A0=B8=E5=BF=83=E7=B1=BB=E5=AE=9E=E4=BE=8B=E5=8C=96?= =?UTF-8?q?=E5=89=8D=E5=8A=A0=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- simple-mind-map/index.js | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/simple-mind-map/index.js b/simple-mind-map/index.js index d7c4a32d..761b4909 100644 --- a/simple-mind-map/index.js +++ b/simple-mind-map/index.js @@ -91,6 +91,15 @@ class MindMap { // 初始化缓存数据 this.initCache() + // 注册插件 + MindMap.pluginList + .filter(plugin => { + return plugin.preload + }) + .forEach(plugin => { + this.initPlugin(plugin) + }) + // 事件类 this.event = new Event({ mindMap: this @@ -120,9 +129,13 @@ class MindMap { this.batchExecution = new BatchExecution() // 注册插件 - MindMap.pluginList.forEach(plugin => { - this.initPlugin(plugin) - }) + MindMap.pluginList + .filter(plugin => { + return !plugin.preload + }) + .forEach(plugin => { + this.initPlugin(plugin) + }) // 添加必要的css样式 this.addCss()