File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -74,15 +74,18 @@ export function getCellProps<RecordType>(
74
74
const addChildrenRowSpan = ( rowSpan : number , index2 : number ) => {
75
75
const _index = index2 + 1 ;
76
76
let _rowSpan = rowSpan ;
77
- // 下面如果是 0 的,增加 +1 逻辑
78
- const thisCellProps = column . onCell ( record , _index ) ;
79
- if ( thisCellProps . rowSpan === 0 ) {
80
- const thisExpanded = expandedKeys . has ( getRowKey ?.( _index ) ) ;
81
- if ( thisExpanded ) {
82
- _rowSpan = _rowSpan + 1 ;
77
+ const rowKey = getRowKey ?.( _index ) ;
78
+ if ( rowKey !== undefined ) {
79
+ // 下面如果是 0 的,增加 +1 逻辑
80
+ const thisCellProps = column . onCell ( record , _index ) ;
81
+ if ( thisCellProps . rowSpan === 0 ) {
82
+ const thisExpanded = expandedKeys . has ( getRowKey ?.( _index ) ) ;
83
+ if ( thisExpanded ) {
84
+ _rowSpan = _rowSpan + 1 ;
85
+ }
86
+ // 继续往下找
87
+ return addChildrenRowSpan ( _rowSpan , _index ) ;
83
88
}
84
- // 继续往下找
85
- return addChildrenRowSpan ( _rowSpan , _index ) ;
86
89
}
87
90
// 找不到后返回
88
91
return _rowSpan ;
You can’t perform that action at this time.
0 commit comments