mirror of
https://github.com/wanglin2/mind-map.git
synced 2026-02-21 18:37:43 +08:00
Feat:修复导入含有和当前画布已有节点uid相同的文件时会重复绘制节点的问题
This commit is contained in:
parent
d517ee338f
commit
0ec16bd136
@ -162,15 +162,14 @@ class MindMap {
|
||||
render(callback, source = '') {
|
||||
this.batchExecution.push('render', () => {
|
||||
this.initTheme()
|
||||
this.renderer.reRender = false
|
||||
this.renderer.render(callback, source)
|
||||
})
|
||||
}
|
||||
|
||||
// 重新渲染
|
||||
reRender(callback, source = '') {
|
||||
this.clearDraw() // 清空画布的操作不能放到队列任务里,否则当reRender后又执行了render,当前回调会被覆盖掉
|
||||
this.batchExecution.push('render', () => {
|
||||
this.clearDraw()
|
||||
this.initTheme()
|
||||
this.renderer.reRender = true
|
||||
this.renderer.render(callback, source)
|
||||
@ -495,7 +494,10 @@ class MindMap {
|
||||
}
|
||||
// 移除插件
|
||||
;[...MindMap.pluginList].forEach(plugin => {
|
||||
if (this[plugin.instanceName] && this[plugin.instanceName].beforePluginDestroy) {
|
||||
if (
|
||||
this[plugin.instanceName] &&
|
||||
this[plugin.instanceName].beforePluginDestroy
|
||||
) {
|
||||
this[plugin.instanceName].beforePluginDestroy()
|
||||
}
|
||||
this[plugin.instanceName] = null
|
||||
|
||||
@ -431,6 +431,7 @@ class Render {
|
||||
this.waitRenderingParams = []
|
||||
this.render(...params)
|
||||
} else {
|
||||
if (this.reRender) this.reRender = false
|
||||
// 触发一次保存,因为修改了渲染树的数据
|
||||
if (
|
||||
this.mindMap.richText &&
|
||||
|
||||
Loading…
Reference in New Issue
Block a user