mirror of
https://github.com/wanglin2/mind-map.git
synced 2026-02-21 10:27:44 +08:00
Feat:插入公式命令支持传入指定的节点
This commit is contained in:
parent
6bbee4a5cc
commit
50f125471e
@ -1282,10 +1282,12 @@ class Render {
|
||||
}
|
||||
|
||||
// 设置节点公式
|
||||
insertFormula(formula) {
|
||||
insertFormula(formula, appointNodes = []) {
|
||||
// 只在富文本模式下可用,并且需要注册Formula插件
|
||||
if (!this.mindMap.richText || !this.mindMap.formula) return
|
||||
this.activeNodeList.forEach(node => {
|
||||
appointNodes = formatDataToArray(appointNodes)
|
||||
const list = appointNodes.length > 0 ? appointNodes : this.activeNodeList
|
||||
list.forEach(node => {
|
||||
this.mindMap.formula.insertFormulaToNode(node, formula)
|
||||
})
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user