mirror of
https://github.com/wanglin2/mind-map.git
synced 2026-02-17 14:04:47 +08:00
Feat:演示插件配置同步思维导图的选项配置
This commit is contained in:
@@ -43,6 +43,18 @@ class Demonstrate {
|
|||||||
this.mindMap.opt.demonstrateConfig || {}
|
this.mindMap.opt.demonstrateConfig || {}
|
||||||
)
|
)
|
||||||
this.needRestorePerformanceMode = false
|
this.needRestorePerformanceMode = false
|
||||||
|
this.onConfigUpdate = this.onConfigUpdate.bind(this)
|
||||||
|
this.mindMap.on('after_update_config', this.onConfigUpdate)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 监听配置更新
|
||||||
|
onConfigUpdate(opt) {
|
||||||
|
if (typeof opt.demonstrateConfig !== 'undefined') {
|
||||||
|
this.config = {
|
||||||
|
...this.config,
|
||||||
|
...opt.demonstrateConfig
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 进入演示模式
|
// 进入演示模式
|
||||||
@@ -417,11 +429,13 @@ class Demonstrate {
|
|||||||
// 插件被移除前做的事情
|
// 插件被移除前做的事情
|
||||||
beforePluginRemove() {
|
beforePluginRemove() {
|
||||||
this.unBindEvent()
|
this.unBindEvent()
|
||||||
|
this.mindMap.off('after_update_config', this.onConfigUpdate)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 插件被卸载前做的事情
|
// 插件被卸载前做的事情
|
||||||
beforePluginDestroy() {
|
beforePluginDestroy() {
|
||||||
this.unBindEvent()
|
this.unBindEvent()
|
||||||
|
this.mindMap.off('after_update_config', this.onConfigUpdate)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user