File tree Expand file tree Collapse file tree 4 files changed +9
-2
lines changed
Expand file tree Collapse file tree 4 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -10,8 +10,12 @@ const props = defineProps({
1010 },
1111});
1212
13- const { sortColumn , setSortColumn } = injectListingContext ();
13+ const { sortColumn , sortDirection , setSortColumn } = injectListingContext ();
1414const isCurrentSortColumn = computed (() => props .column .field === sortColumn .value );
15+ const sortIcon = computed (() => {
16+ if (! isCurrentSortColumn .value ) return null ;
17+ return sortDirection .value === ' asc' ? ' sort-asc' : ' sort-desc' ;
18+ });
1519 </script >
1620
1721<template >
@@ -20,7 +24,7 @@ const isCurrentSortColumn = computed(() => props.column.field === sortColumn.val
2024 <Button
2125 v-else
2226 :text =" __(column.label)"
23- :icon-append =" isCurrentSortColumn ? 'up-down' : null "
27+ :icon-append =" sortIcon "
2428 size =" sm"
2529 variant =" ghost"
2630 class =" -mt-2 -mb-1 -ms-3 text-sm! font-medium! text-gray-900! dark:text-gray-400!"
Original file line number Diff line number Diff line change @@ -596,6 +596,7 @@ provideListingContext({
596596 isColumnVisible,
597597 hiddenColumns,
598598 sortColumn,
599+ sortDirection,
599600 setSortColumn,
600601 selections,
601602 maxSelections: toRef (() => props .maxSelections ),
You can’t perform that action at this time.
0 commit comments