Feat:新增实例化时是否进行一次历史数据入栈操作的选项
This commit is contained in:
parent
0a2e4e7c14
commit
74d302639a
@ -523,4 +523,8 @@ const mindMap = new MindMap({
|
|||||||
<img src="./web/src/assets/avatar/4399行星元帅.jpg" style="width: 50px;height: 50px;" />
|
<img src="./web/src/assets/avatar/4399行星元帅.jpg" style="width: 50px;height: 50px;" />
|
||||||
<span>4399行星元帅</span>
|
<span>4399行星元帅</span>
|
||||||
</span>
|
</span>
|
||||||
|
<span>
|
||||||
|
<img src="./web/src/assets/avatar/Xavier.png" style="width: 50px;height: 50px;" />
|
||||||
|
<span>Xavier</span>
|
||||||
|
</span>
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@ -123,9 +123,11 @@ class MindMap {
|
|||||||
|
|
||||||
// 初始渲染
|
// 初始渲染
|
||||||
this.render(this.opt.fit ? () => this.view.fit() : () => {})
|
this.render(this.opt.fit ? () => this.view.fit() : () => {})
|
||||||
setTimeout(() => {
|
|
||||||
if (this.opt.data) this.command.addHistory()
|
// 将初始数据添加到历史记录堆栈中
|
||||||
}, 0)
|
if (this.opt.addHistoryOnInit && this.opt.data) {
|
||||||
|
this.command.addHistory()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 配置参数处理
|
// 配置参数处理
|
||||||
@ -574,7 +576,7 @@ class MindMap {
|
|||||||
this.watermark.isInExport = false
|
this.watermark.isInExport = false
|
||||||
}
|
}
|
||||||
// 添加必要的样式
|
// 添加必要的样式
|
||||||
;[this.joinCss(), ...cssTextList].forEach(s => {
|
[this.joinCss(), ...cssTextList].forEach(s => {
|
||||||
clone.add(SVG(`<style>${s}</style>`))
|
clone.add(SVG(`<style>${s}</style>`))
|
||||||
})
|
})
|
||||||
// 附加内容
|
// 附加内容
|
||||||
|
|||||||
@ -265,6 +265,9 @@ export const defaultOpt = {
|
|||||||
maxNodeTextModifyWidth: -1,
|
maxNodeTextModifyWidth: -1,
|
||||||
// 自定义处理节点的连线方法,可以传递一个函数,函数接收三个参数:node(节点实例)、line(节点的某条连线,@svgjs库的path对象), { width, color, dasharray },dasharray(该条连线的虚线样式,为none代表实线),你可以修改line对象来达到修改节点连线样式的效果,比如增加流动效果
|
// 自定义处理节点的连线方法,可以传递一个函数,函数接收三个参数:node(节点实例)、line(节点的某条连线,@svgjs库的path对象), { width, color, dasharray },dasharray(该条连线的虚线样式,为none代表实线),你可以修改line对象来达到修改节点连线样式的效果,比如增加流动效果
|
||||||
customHandleLine: null,
|
customHandleLine: null,
|
||||||
|
// 实例化完后是否立刻进行一次历史数据入栈操作
|
||||||
|
// 即调用mindMap.command.addHistory方法
|
||||||
|
addHistoryOnInit: true,
|
||||||
|
|
||||||
// 【Select插件】
|
// 【Select插件】
|
||||||
// 多选节点时鼠标移动到边缘时的画布移动偏移量
|
// 多选节点时鼠标移动到边缘时的画布移动偏移量
|
||||||
|
|||||||
BIN
web/src/assets/avatar/Xavier.png
Normal file
BIN
web/src/assets/avatar/Xavier.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 28 KiB |
Loading…
x
Reference in New Issue
Block a user