mirror of
https://github.com/wanglin2/mind-map.git
synced 2026-02-21 10:27:44 +08:00
Fix:修复删除当前激活的节点的所有子节点后,展开收起按钮没有消失的问题
This commit is contained in:
parent
c1217f1532
commit
6b9eee7fc6
@ -572,9 +572,10 @@ class Node {
|
||||
}
|
||||
this.updateNodeActiveClass()
|
||||
let { alwaysShowExpandBtn } = this.mindMap.opt
|
||||
const childrenLength = this.nodeData.children.length
|
||||
if (alwaysShowExpandBtn) {
|
||||
// 需要移除展开收缩按钮
|
||||
if (this._expandBtn && this.nodeData.children.length <= 0) {
|
||||
if (this._expandBtn && childrenLength <= 0) {
|
||||
this.removeExpandBtn()
|
||||
} else {
|
||||
// 更新展开收起按钮
|
||||
@ -583,7 +584,9 @@ class Node {
|
||||
} else {
|
||||
let { isActive, expand } = this.getData()
|
||||
// 展开状态且非激活状态,且当前鼠标不在它上面,才隐藏
|
||||
if (expand && !isActive && !this._isMouseenter) {
|
||||
if (childrenLength <= 0) {
|
||||
this.removeExpandBtn()
|
||||
} else if (expand && !isActive && !this._isMouseenter) {
|
||||
this.hideExpandBtn()
|
||||
} else {
|
||||
this.showExpandBtn()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user