Feat:插件新增preload配置,支持在核心类实例化前加载

This commit is contained in:
街角小林
2025-04-02 09:44:42 +08:00
parent 94ed53b31f
commit 9661aa55c5

View File

@@ -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,7 +129,11 @@ class MindMap {
this.batchExecution = new BatchExecution()
// 注册插件
MindMap.pluginList.forEach(plugin => {
MindMap.pluginList
.filter(plugin => {
return !plugin.preload
})
.forEach(plugin => {
this.initPlugin(plugin)
})