Skip to content

Commit 99f61c8

Browse files
committed
fix: fix type
1 parent 5524853 commit 99f61c8

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/VirtualTable/BodyLine.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,15 @@ const BodyLine = React.forwardRef<HTMLDivElement, BodyLineProps>((props, ref) =>
4141
let expandRowNode: React.ReactElement;
4242
if (rowSupportExpand && expanded) {
4343
const expandContent = expandedRowRender(record, index, indent + 1, expanded);
44-
const computedExpandedRowClassName = expandedRowClassName?.(record, index, indent);
44+
45+
let computedExpandedRowClassName = '';
46+
47+
if (typeof expandedRowClassName === 'string') {
48+
computedExpandedRowClassName = expandedRowClassName;
49+
}
50+
if (typeof expandedRowClassName === 'function') {
51+
computedExpandedRowClassName = expandedRowClassName(record, index, indent);
52+
}
4553

4654
let additionalProps: React.TdHTMLAttributes<HTMLElement> = {};
4755
if (fixColumn) {

0 commit comments

Comments
 (0)