diff --git a/index.html b/index.html index 0f06adea..3a8f0d3d 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -一个简单的web思维导图实现
\ No newline at end of file +一个简单的web思维导图实现
\ No newline at end of file diff --git a/simple-mind-map/src/Node.js b/simple-mind-map/src/Node.js index 99add85d..fd7b113c 100644 --- a/simple-mind-map/src/Node.js +++ b/simple-mind-map/src/Node.js @@ -1016,7 +1016,6 @@ class Node { * @Desc: 创建或更新展开收缩按钮内容 */ updateExpandBtnNode() { - if (this.children.length === 0) return if (this._expandBtn) { this._expandBtn.clear() } @@ -1031,7 +1030,7 @@ class Node { node.x(0).y(-this.expandBtnSize / 2) fillNode.x(0).y(-this.expandBtnSize / 2) this.style.iconBtn(node, fillNode) - this._expandBtn.add(fillNode).add(node) + if (this._expandBtn) this._expandBtn.add(fillNode).add(node) } /**