Skip to content

Commit

Permalink
fix: 🐛expand can not hide expanded children
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyjone committed Apr 21, 2023
1 parent 33928f6 commit 84b37f7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/models/data/row.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: JeremyJone
* @Date: 2021-09-09 15:50:52
* @LastEditors: JeremyJone
* @LastEditTime: 2023-04-22 01:17:28
* @LastEditTime: 2023-04-22 02:26:23
* @Description: 一条数据类
*/

Expand Down Expand Up @@ -85,7 +85,13 @@ export default class RowItem {
* 获取当前数据是否应该隐藏
*/
get hide() {
return !this.isExpand && this.level > 0;
if (!this.isExpand) return true;
let parent = this.parentNode;
while (parent) {
if (!parent.isExpand) return true;
parent = parent.parentNode;
}
return false;
}

/**
Expand Down

0 comments on commit 84b37f7

Please sign in to comment.