Skip to content

Commit

Permalink
fix: default sorting logic in student list
Browse files Browse the repository at this point in the history
- Ensure consistent sorting behavior between browser
  • Loading branch information
U1805 committed Jan 28, 2025
1 parent b38ce65 commit 7405fd5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,9 @@ const processData = debounce(() => {
// sort
.sort((a, b) => {
if (filter_condition.value.sort_type === '') {
return filter_condition.value.sort_asc ? -1 : 1
return filter_condition.value.sort_asc ?
database.value.indexOf(a) - database.value.indexOf(b) :
database.value.indexOf(b) - database.value.indexOf(a)
}
if (filter_condition.value.sort_type === 'Birthday') {
Expand Down

0 comments on commit 7405fd5

Please sign in to comment.