fix: 传autoExpandParent一直为true时收起节点bug

This commit is contained in:
gx-mac 2021-03-08 16:03:03 +08:00
parent f7b367f403
commit 1dc8fc2b9d
1 changed files with 3 additions and 1 deletions

View File

@ -818,7 +818,9 @@ onExpand(treeNode,keyType) {
} else if (props.autoExpandParent) {
expandedPositionArr.forEach(p => {
if ((p.split('-').length > pos.split('-').length && isInclude(pos.split('-'), p.split('-')) || pos === p) && filterExpandedKeys.indexOf(newKey) === -1) {
filterExpandedKeys.push(newKey);
if (!props.canCloseFreely || this.cacheExpandedKeys.has(newKey)) {
filterExpandedKeys.push(newKey);
}
}
});
}