Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 task
hekang456 opened this issue Nov 26, 2024 · 1 comment
Open
1 task

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

hekang456 opened this issue Nov 26, 2024 · 1 comment

Comments

@hekang456
Copy link

  • 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,并且点击不会正确的触发排序功能。

渲染错误的示例

@YiMo1
Copy link

YiMo1 commented Nov 28, 2024

你需要设置 sorter.multiple 字段以配置多列排序优先级。参考

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants