Skip to content

Commit ff959d9

Browse files
committed
feat: review
1 parent 668ef08 commit ff959d9

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/Body/BodyRow.tsx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff 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 {

0 commit comments

Comments
 (0)