diff --git a/index.html b/index.html index 553768bd..a8ed770a 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -思绪思维导图
\ No newline at end of file +思绪思维导图
\ No newline at end of file diff --git a/simple-mind-map/package.json b/simple-mind-map/package.json index 0ef87aee..bb56420b 100644 --- a/simple-mind-map/package.json +++ b/simple-mind-map/package.json @@ -1,6 +1,6 @@ { "name": "simple-mind-map", - "version": "0.6.9", + "version": "0.6.9-fix.1", "description": "一个简单的web在线思维导图", "authors": [ { diff --git a/simple-mind-map/src/core/render/Render.js b/simple-mind-map/src/core/render/Render.js index 217751de..0ae17ed6 100644 --- a/simple-mind-map/src/core/render/Render.js +++ b/simple-mind-map/src/core/render/Render.js @@ -48,7 +48,7 @@ class Render { this.themeConfig = this.mindMap.themeConfig this.draw = this.mindMap.draw // 渲染树,操作过程中修改的都是这里的数据 - this.renderTree = merge({}, this.mindMap.opt.data || {}) + this.renderTree = merge({}, simpleDeepClone(this.mindMap.opt.data) || {}) // 是否重新渲染 this.reRender = false // 是否正在渲染中 diff --git a/simple-mind-map/src/plugins/Search.js b/simple-mind-map/src/plugins/Search.js index 5bbd3e77..7202ef5c 100644 --- a/simple-mind-map/src/plugins/Search.js +++ b/simple-mind-map/src/plugins/Search.js @@ -13,15 +13,18 @@ class Search { this.matchNodeList = [] // 当前所在的节点列表索引 this.currentIndex = -1 - // 是否正在跳转中 - this.isJumping = false + // 不要复位搜索文本 + this.notResetSearchText = false this.onDataChange = this.onDataChange.bind(this) this.mindMap.on('data_change', this.onDataChange) } // 节点数据改变了,需要重新搜索 onDataChange() { - if (this.isJumping) return + if (this.notResetSearchText) { + this.notResetSearchText = false + return + } this.searchText = '' } @@ -48,7 +51,7 @@ class Search { this.searchText = '' this.matchNodeList = [] this.currentIndex = -1 - this.isJumping = false + this.notResetSearchText = false this.isSearching = false this.emitEvent() } @@ -77,9 +80,8 @@ class Search { this.currentIndex = 0 } let currentNode = this.matchNodeList[this.currentIndex] - this.isJumping = true + this.notResetSearchText = true this.mindMap.execCommand('GO_TARGET_NODE', currentNode, () => { - this.isJumping = false callback() }) } @@ -92,10 +94,16 @@ class Search { let currentNode = this.matchNodeList[this.currentIndex] if (!currentNode) return let text = this.getReplacedText(currentNode, this.searchText, replaceText) + this.notResetSearchText = true currentNode.setText(text, currentNode.nodeData.data.richText) this.matchNodeList = this.matchNodeList.filter(node => { return currentNode !== node }) + if (this.currentIndex > this.matchNodeList.length - 1) { + this.currentIndex = -1 + } else { + this.currentIndex-- + } this.emitEvent() } diff --git a/web/src/pages/Doc/en/changelog/index.md b/web/src/pages/Doc/en/changelog/index.md index f09ad06d..a34737f9 100644 --- a/web/src/pages/Doc/en/changelog/index.md +++ b/web/src/pages/Doc/en/changelog/index.md @@ -1,5 +1,11 @@ # Changelog +## 0.6.9-fix.1 + +Fix: 1.Fix the issue of incorrect replacement after a single search. + +New: 1.We will no longer directly modify the incoming data object, but will make a deep copy internally. + ## 0.6.9 Fix: 1.Fixed an issue where setting styles to summary nodes would cause summary nodes to disappear. 2.Fixed the issue of node content not rendering when creating a root instance again when customizing node content. 3.Fix the issue of losing focus when adding a new node while the node is in editing. 2.Fix the issue of continuously pressing the tab key not being able to continuously create child nodes. diff --git a/web/src/pages/Doc/en/changelog/index.vue b/web/src/pages/Doc/en/changelog/index.vue index 00fd1d31..7b75a64c 100644 --- a/web/src/pages/Doc/en/changelog/index.vue +++ b/web/src/pages/Doc/en/changelog/index.vue @@ -1,6 +1,9 @@