Skip to content

【表格Table】排序只能对一列起作用 #7954

@hekang456

Description

@hekang456
  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

last

Environment

any

Reproduction link

https://github.com/vueComponent/ant-design-vue

Steps to reproduce

表格的column数组中,对其中超过一列设置排序属性sortOrder,这时候渲染会错误。
比如:

const columns: TableColumnType<TableDataType>[] = [
{
    title: 'Name',
    dataIndex: 'name',
    sorter: true,
    sortOrder: 'descend'   // 排序
},
{
    title: 'Age',
    dataIndex: 'age',
    sorter: true,
    sortOrder: 'descend'   // 排序
},
{
    title: 'Address',
    dataIndex: 'address'
}
];

What is expected?

排序的UI根据sortOrder设置的值进行展示,并且点击时候会进行切换。各列的排序互不影响。

What is actually happening?

当设置sortOrder的列数大于1,第二列及以后的列都会展示错误的UI,并且点击不会正确的触发排序功能。

渲染错误的示例

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions