File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ export function getCellProps<RecordType>(
4545 expanded,
4646 hasNestChildren,
4747 onTriggerExpand,
48+ expandable,
4849 expandedKeys,
4950 } = rowInfo ;
5051
@@ -94,14 +95,17 @@ export function getCellProps<RecordType>(
9495 let additionalCellProps : React . TdHTMLAttributes < HTMLElement > ;
9596 if ( column . onCell ) {
9697 additionalCellProps = column . onCell ( record , index ) ;
97- if ( additionalCellProps . rowSpan > 0 ) {
98- // 本身展开 +1
99- if ( expanded ) {
100- additionalCellProps . rowSpan = additionalCellProps . rowSpan + 1 ;
98+ // 开启 expanded 的增加下面逻辑
99+ if ( expandable ) {
100+ if ( additionalCellProps . rowSpan > 0 ) {
101+ // 本身展开 +1
102+ if ( expanded ) {
103+ additionalCellProps . rowSpan = additionalCellProps . rowSpan + 1 ;
104+ }
105+ additionalCellProps . rowSpan = addChildrenRowSpan ( additionalCellProps . rowSpan , index ) ;
101106 }
102- additionalCellProps . rowSpan = addChildrenRowSpan ( additionalCellProps . rowSpan , index ) ;
107+ // console.log(' additionalCellProps.rowSpan', additionalCellProps.rowSpan );
103108 }
104- console . log ( 'additionalCellProps.rowSpan' , additionalCellProps . rowSpan ) ;
105109 }
106110
107111 return {
You can’t perform that action at this time.
0 commit comments