mirror of
https://github.com/wanglin2/mind-map.git
synced 2026-02-17 22:08:25 +08:00
修复回退问题
This commit is contained in:
@@ -1 +1 @@
|
||||
<!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>一个简单的web思维导图实现</title><link href="dist/css/app.3c1796da.css" rel="preload" as="style"><link href="dist/css/chunk-vendors.37b3d8f8.css" rel="preload" as="style"><link href="dist/js/app.d09d6b0a.js" rel="preload" as="script"><link href="dist/js/chunk-vendors.52f014f8.js" rel="preload" as="script"><link href="dist/css/chunk-vendors.37b3d8f8.css" rel="stylesheet"><link href="dist/css/app.3c1796da.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but thoughts doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="dist/js/chunk-vendors.52f014f8.js"></script><script src="dist/js/app.d09d6b0a.js"></script></body></html>
|
||||
<!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>一个简单的web思维导图实现</title><link href="dist/css/app.e587f860.css" rel="preload" as="style"><link href="dist/css/chunk-vendors.37b3d8f8.css" rel="preload" as="style"><link href="dist/js/app.eed10b94.js" rel="preload" as="script"><link href="dist/js/chunk-vendors.52f014f8.js" rel="preload" as="script"><link href="dist/css/chunk-vendors.37b3d8f8.css" rel="stylesheet"><link href="dist/css/app.e587f860.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but thoughts doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="dist/js/chunk-vendors.52f014f8.js"></script><script src="dist/js/app.eed10b94.js"></script></body></html>
|
||||
@@ -76,7 +76,7 @@ class Render {
|
||||
this.mindMap.on('draw_click', () => {
|
||||
// 清除激活状态
|
||||
if (this.activeNodeList.length > 0) {
|
||||
this.clearActive()
|
||||
this.mindMap.execCommand('CLEAR_ACTIVE_NODE')
|
||||
this.mindMap.emit('node_active', null, [])
|
||||
}
|
||||
})
|
||||
@@ -222,7 +222,7 @@ class Render {
|
||||
*/
|
||||
clearActive() {
|
||||
this.activeNodeList.forEach((item) => {
|
||||
this.mindMap.execCommand('SET_NODE_ACTIVE', item, false)
|
||||
this.setNodeActive(item, false)
|
||||
})
|
||||
this.activeNodeList = []
|
||||
}
|
||||
@@ -290,6 +290,7 @@ class Render {
|
||||
* @Desc: 回退
|
||||
*/
|
||||
back(step) {
|
||||
this.clearAllActive()
|
||||
let data = this.mindMap.command.back(step)
|
||||
if (data) {
|
||||
this.renderTree = data
|
||||
@@ -304,6 +305,7 @@ class Render {
|
||||
* @Desc: 前进
|
||||
*/
|
||||
forward(step) {
|
||||
this.clearAllActive()
|
||||
let data = this.mindMap.command.forward(step)
|
||||
if (data) {
|
||||
this.renderTree = data
|
||||
@@ -324,6 +326,9 @@ class Render {
|
||||
if (first.isRoot) {
|
||||
this.insertChildNode()
|
||||
} else {
|
||||
if (first.layerIndex === 1) {
|
||||
first.parent.initRender = true
|
||||
}
|
||||
let index = this.getNodeIndex(first)
|
||||
first.parent.nodeData.children.splice(index + 1, 0, {
|
||||
"data": {
|
||||
|
||||
@@ -74,6 +74,9 @@ class Base {
|
||||
newNode.getSize()
|
||||
// 数据关联实际节点
|
||||
data._node = newNode
|
||||
if (data.data.isActive) {
|
||||
this.renderer.addActiveNode(newNode)
|
||||
}
|
||||
}
|
||||
// 根节点
|
||||
if (isRoot) {
|
||||
|
||||
Reference in New Issue
Block a user