diff --git a/src/VirtualTable/BodyLine.tsx b/src/VirtualTable/BodyLine.tsx index d072c6954..21562f69b 100644 --- a/src/VirtualTable/BodyLine.tsx +++ b/src/VirtualTable/BodyLine.tsx @@ -25,10 +25,16 @@ const BodyLine = React.forwardRef((props, ref) => const { data, index, className, rowKey, style, extra, getHeight, ...restProps } = props; const { record, indent, index: renderIndex } = data; - const { scrollX, flattenColumns, prefixCls, fixColumn, componentWidth } = useContext( - TableContext, - ['prefixCls', 'flattenColumns', 'fixColumn', 'componentWidth', 'scrollX'], - ); + const { scrollX, flattenColumns, prefixCls, fixColumn, componentWidth, classNames, styles } = + useContext(TableContext, [ + 'prefixCls', + 'flattenColumns', + 'fixColumn', + 'componentWidth', + 'scrollX', + 'classNames', + 'styles', + ]); const { getComponent } = useContext(StaticContext, ['getComponent']); const rowInfo = useRowInfo(record, rowKey, index, indent); @@ -93,16 +99,18 @@ const BodyLine = React.forwardRef((props, ref) => {...restProps} data-row-key={rowKey} ref={rowSupportExpand ? null : ref} - className={clsx(className, `${prefixCls}-row`, rowProps?.className, { + className={clsx(className, `${prefixCls}-row`, rowProps?.className, classNames?.body?.row, { [expandedClsName]: indent >= 1, [`${prefixCls}-row-extra`]: extra, })} - style={{ ...rowStyle, ...rowProps?.style }} + style={{ ...rowStyle, ...rowProps?.style, ...styles?.body?.row }} > {flattenColumns.map((column, colIndex) => { return (