Feat:插件新增preload配置,支持在核心类实例化前加载
This commit is contained in:
parent
94ed53b31f
commit
9661aa55c5
@ -91,6 +91,15 @@ class MindMap {
|
|||||||
// 初始化缓存数据
|
// 初始化缓存数据
|
||||||
this.initCache()
|
this.initCache()
|
||||||
|
|
||||||
|
// 注册插件
|
||||||
|
MindMap.pluginList
|
||||||
|
.filter(plugin => {
|
||||||
|
return plugin.preload
|
||||||
|
})
|
||||||
|
.forEach(plugin => {
|
||||||
|
this.initPlugin(plugin)
|
||||||
|
})
|
||||||
|
|
||||||
// 事件类
|
// 事件类
|
||||||
this.event = new Event({
|
this.event = new Event({
|
||||||
mindMap: this
|
mindMap: this
|
||||||
@ -120,9 +129,13 @@ class MindMap {
|
|||||||
this.batchExecution = new BatchExecution()
|
this.batchExecution = new BatchExecution()
|
||||||
|
|
||||||
// 注册插件
|
// 注册插件
|
||||||
MindMap.pluginList.forEach(plugin => {
|
MindMap.pluginList
|
||||||
this.initPlugin(plugin)
|
.filter(plugin => {
|
||||||
})
|
return !plugin.preload
|
||||||
|
})
|
||||||
|
.forEach(plugin => {
|
||||||
|
this.initPlugin(plugin)
|
||||||
|
})
|
||||||
|
|
||||||
// 添加必要的css样式
|
// 添加必要的css样式
|
||||||
this.addCss()
|
this.addCss()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user