Skip to content

Commit

Permalink
fix: fix sort function in getCheckboxState() #3394
Browse files Browse the repository at this point in the history
  • Loading branch information
Rui-Sun committed Feb 19, 2025
1 parent 689d3ff commit 2d84616
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vtable",
"comment": "fix: fix sort function in getCheckboxState() #3394",
"type": "none"
}
],
"packageName": "@visactor/vtable"
}
4 changes: 3 additions & 1 deletion packages/vtable/src/ListTable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1080,7 +1080,9 @@ export class ListTable extends BaseTable implements ListTableAPI {
if (isValid(field)) {
// let stateArr = this.stateManager.checkedState.values() as any;
// map按照key(dataIndex)的升序输出value
const keys = Array.from(this.stateManager.checkedState.keys()).sort();
const keys = Array.from(this.stateManager.checkedState.keys()).sort(
(a: string, b: string) => Number(a) - Number(b)
);
let stateArr = keys.map(key => this.stateManager.checkedState.get(key));

if (this.options.groupBy) {
Expand Down

0 comments on commit 2d84616

Please sign in to comment.