mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-04 13:08:41 +08:00
Use classNames to set ant-column-sort Table attribute
This commit is contained in:
parent
75a6a562a0
commit
d21523ef8c
@ -345,7 +345,7 @@ export default class Table<T> extends React.Component<TableProps<T>, any> {
|
|||||||
let columnTitle = this.props.defaultSortOrder.columnTitle;
|
let columnTitle = this.props.defaultSortOrder.columnTitle;
|
||||||
return {
|
return {
|
||||||
sortColumn: flatFilter(columns || this.columns || [], column => column.title === columnTitle)[0],
|
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<T> extends React.Component<TableProps<T>, any> {
|
|||||||
if (column.sorter) {
|
if (column.sorter) {
|
||||||
let isSortColumn = this.isSortColumn(column);
|
let isSortColumn = this.isSortColumn(column);
|
||||||
if (isSortColumn) {
|
if (isSortColumn) {
|
||||||
column.className = column.className || '';
|
column.className = classNames(column.className, {
|
||||||
if (sortOrder) {
|
[`${prefixCls}-column-sort`]: sortOrder,
|
||||||
column.className += ` ${prefixCls}-column-sort`;
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
const isAscend = isSortColumn && sortOrder === 'ascend';
|
const isAscend = isSortColumn && sortOrder === 'ascend';
|
||||||
const isDescend = isSortColumn && sortOrder === 'descend';
|
const isDescend = isSortColumn && sortOrder === 'descend';
|
||||||
|
Loading…
Reference in New Issue
Block a user