mirror of
https://github.com/wanglin2/mind-map.git
synced 2026-02-28 13:57:48 +08:00
Fix:修复大纲里创建新节点时节点样式丢失的问题
This commit is contained in:
parent
a161661c6b
commit
94230f8ec6
@ -426,11 +426,14 @@ class Render {
|
||||
first.parent.destroy()
|
||||
}
|
||||
let index = this.getNodeIndex(first)
|
||||
let isRichText = !!this.mindMap.richText
|
||||
first.parent.nodeData.children.splice(index + 1, 0, {
|
||||
inserting: openEdit,
|
||||
data: {
|
||||
text: text,
|
||||
expand: true,
|
||||
richText: isRichText,
|
||||
resetRichText: isRichText,
|
||||
...(appointData || {})
|
||||
},
|
||||
children: []
|
||||
@ -455,11 +458,14 @@ class Render {
|
||||
node.nodeData.children = []
|
||||
}
|
||||
let text = node.isRoot ? defaultInsertSecondLevelNodeText : defaultInsertBelowSecondLevelNodeText
|
||||
let isRichText = !!this.mindMap.richText
|
||||
node.nodeData.children.push({
|
||||
inserting: openEdit,
|
||||
data: {
|
||||
text: text,
|
||||
expand: true,
|
||||
richText: isRichText,
|
||||
resetRichText: isRichText,
|
||||
...(appointData || {})
|
||||
},
|
||||
children: []
|
||||
|
||||
@ -49,8 +49,7 @@ export default {
|
||||
return data.data.richText ? data.data.text : data.data.text.replaceAll(/\n/g, '</br>')
|
||||
}
|
||||
},
|
||||
notHandleDataChange: false,
|
||||
isCreateNode: false
|
||||
notHandleDataChange: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@ -77,10 +76,6 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
onBlur(e, node) {
|
||||
// if (this.isCreateNode) {
|
||||
// this.isCreateNode = false
|
||||
// return
|
||||
// }
|
||||
const richText = node.data.data.richText
|
||||
if (richText) {
|
||||
node.data._node.setText(e.target.innerHTML, true)
|
||||
@ -107,14 +102,12 @@ export default {
|
||||
// 插入兄弟节点
|
||||
insertNode() {
|
||||
this.notHandleDataChange = false
|
||||
this.isCreateNode = true
|
||||
this.mindMap.execCommand('INSERT_NODE', false)
|
||||
},
|
||||
|
||||
// 插入下级节点
|
||||
insertChildNode() {
|
||||
this.notHandleDataChange = false
|
||||
this.isCreateNode = true
|
||||
this.mindMap.execCommand('INSERT_CHILD_NODE', false)
|
||||
},
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user