Skip to content

Commit 34ab34a

Browse files
committed
fix: table customRender set class and style not work #2004
1 parent 0b7481e commit 34ab34a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

components/vc-table/src/TableCell.jsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ export default {
7070
if (isInvalidRenderCellText(text)) {
7171
tdProps.attrs = text.attrs || {};
7272
tdProps.props = text.props || {};
73+
tdProps.class = text.class;
74+
tdProps.style = text.style;
7375
colSpan = tdProps.attrs.colSpan;
7476
rowSpan = tdProps.attrs.rowSpan;
7577
text = text.children;
@@ -99,7 +101,7 @@ export default {
99101
tdProps.style = { textAlign: column.align, ...tdProps.style };
100102
}
101103

102-
const cellClassName = classNames(className || column.class, {
104+
const cellClassName = classNames(className, column.class, {
103105
[`${prefixCls}-cell-ellipsis`]: !!column.ellipsis,
104106
// 如果有宽度,增加断行处理
105107
// https://github.com/ant-design/ant-design/issues/13825#issuecomment-449889241

0 commit comments

Comments
 (0)