diff --git a/components/table/Table.tsx b/components/table/Table.tsx index dc75b72b41..5746065a3f 100755 --- a/components/table/Table.tsx +++ b/components/table/Table.tsx @@ -345,7 +345,7 @@ export default class Table extends React.Component, any> { let columnTitle = this.props.defaultSortOrder.columnTitle; return { sortColumn: flatFilter(columns || this.columns || [], column => column.title === columnTitle)[0], - sortOrder: this.props.defaultSortOrder.sortOrder + sortOrder: this.props.defaultSortOrder.sortOrder, }; } @@ -753,10 +753,9 @@ export default class Table extends React.Component, any> { if (column.sorter) { let isSortColumn = this.isSortColumn(column); if (isSortColumn) { - column.className = column.className || ''; - if (sortOrder) { - column.className += ` ${prefixCls}-column-sort`; - } + column.className = classNames(column.className, { + [`${prefixCls}-column-sort`]: sortOrder, + }); } const isAscend = isSortColumn && sortOrder === 'ascend'; const isDescend = isSortColumn && sortOrder === 'descend';