I have a v-data-table
with headers set, but I can't get the custom sort function to work.
<v-data-table v-else :items-per-page="itemsPerPage" density="compact" :headers="headers" :items="rows" :no-data-text="t('label_no_data')" sticky class="elevation-1 text-caption" :class="{'mobile-table':IsMobile}" />
const headers = ref([
{ key: "PersonID", title: "EDB Person ID", sortable:true },
{ key: "FirstName", title: "Name", sortable:true },
{ key: "PersonPersonTimekeeperMaps", title: "Timekeeper ID", sortable:false },
{ key: "Created", title: "Created", sortable:true, sort:(d1: string | null | undefined, d2: string | null | undefined) => {
const date1 = new Date(d1 as string);
const date2 = new Date(d2 as string);
if (date1 > date2) return -1;
if (date1 < date2) return 1;
return 0;
} }
]);
It never hits the breakpoint in the function in dev tools. And it is not respecting the logic I set. It seems to just do the default sort on its own.