Skip to content

Commit

Permalink
chore(table): 代码优化
Browse files Browse the repository at this point in the history
  • Loading branch information
zyprepare committed Jul 27, 2023
1 parent 936a947 commit dbda0b1
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions packages/ui/table/src/use-table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -534,10 +534,7 @@ export const useTable = ({
const sorter = columns.filter((d) => d.dataKey === activeSorterColumn)[0]?.sorter

if (sorter) {
_data =
activeSorterType === 'ascend'
? [..._data].sort(sorter)
: [..._data].sort(sorter).reverse()
activeSorterType === 'ascend' ? _data.sort(sorter) : _data.sort(sorter).reverse()

// 平铺的树形结构排序
if (_data.some((d) => d.depth !== 0)) {
Expand Down

0 comments on commit dbda0b1

Please sign in to comment.