Demo:修复在大纲内添加新节点时节点错乱的问题
This commit is contained in:
parent
983e55bd1d
commit
af148fef27
@ -50,6 +50,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
notHandleDataChange: false,
|
notHandleDataChange: false,
|
||||||
|
isCreateNode: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -76,6 +77,10 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onBlur(e, node) {
|
onBlur(e, node) {
|
||||||
|
if (this.isCreateNode) {
|
||||||
|
this.isCreateNode = false
|
||||||
|
return
|
||||||
|
}
|
||||||
node.data._node.setText(e.target.innerText)
|
node.data._node.setText(e.target.innerText)
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -97,12 +102,14 @@ export default {
|
|||||||
// 插入兄弟节点
|
// 插入兄弟节点
|
||||||
insertNode() {
|
insertNode() {
|
||||||
this.notHandleDataChange = false
|
this.notHandleDataChange = false
|
||||||
|
this.isCreateNode = true
|
||||||
this.mindMap.execCommand('INSERT_NODE', false)
|
this.mindMap.execCommand('INSERT_NODE', false)
|
||||||
},
|
},
|
||||||
|
|
||||||
// 插入下级节点
|
// 插入下级节点
|
||||||
insertChildNode() {
|
insertChildNode() {
|
||||||
this.notHandleDataChange = false
|
this.notHandleDataChange = false
|
||||||
|
this.isCreateNode = true
|
||||||
this.mindMap.execCommand('INSERT_CHILD_NODE', false)
|
this.mindMap.execCommand('INSERT_CHILD_NODE', false)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user