fix: table column sort params should support cancel sort (#3372)

* fix: sort params

* fix: sort params
This commit is contained in:
katherinehhh 2024-01-12 09:50:17 +08:00 committed by GitHub
parent 57a2bac72a
commit dfb4421484
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -174,11 +174,7 @@ export const useTableBlockProps = () => {
ctx.service.refresh();
},
onChange({ current, pageSize }, filters, sorter) {
const sort = sorter.order
? sorter.order === `ascend`
? [sorter.field]
: [`-${sorter.field}`]
: globalSort || ctx.service.params?.[0]?.sort;
const sort = sorter.order ? (sorter.order === `ascend` ? [sorter.field] : [`-${sorter.field}`]) : globalSort;
ctx.service.run({ ...ctx.service.params?.[0], page: current, pageSize, sort });
},
onClickRow(record, setSelectedRow, selectedRow) {