Skip to content

Commit d434af9

Browse files
authored
Merge pull request #71 from HC200ok/feature/add-server-must-sort
Feature/add server must sort
2 parents 7b89457 + 1e13d95 commit d434af9

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"author": "HC200ok",
44
"description": "A customizable and easy-to-use data table component made with Vue.js 3.x.",
55
"private": false,
6-
"version": "1.3.12",
6+
"version": "1.3.13",
77
"types": "./types/main.d.ts",
88
"license": "MIT",
99
"files": [

src/components/DataTable.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,10 @@ const props = defineProps({
405405
type: Boolean,
406406
default: false,
407407
},
408+
mustSort: {
409+
type: Boolean,
410+
default: false,
411+
},
408412
});
409413
410414
// style related computed variables
@@ -719,7 +723,7 @@ const updateSortField = (newSortBy: string, oldSortType: SortType | 'none') => {
719723
} else if (oldSortType === 'asc') {
720724
newSortType = 'desc';
721725
} else {
722-
newSortType = null;
726+
newSortType = (props.mustSort) ? 'asc' : null;
723727
}
724728
725729
if (serverOptionsComputed.value) {

src/modes/Client.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
:header-item-class-name="headerItemClassNameFunction"
7070
:body-item-class-name="bodyItemClassNameFunction"
7171
border-cell
72+
must-sort
7273
>
7374
<template #expand="item">
7475
<div style="padding: 15px">

0 commit comments

Comments
 (0)