feat(Table): add sort-mode prop

Resolves #1149
This commit is contained in:
Benjamin Canac
2024-01-09 14:54:13 +01:00
parent c6841d06a4
commit 56e0c9a9a0
3 changed files with 77 additions and 39 deletions

View File

@@ -132,6 +132,10 @@ export default defineComponent({
type: Object as PropType<{ column: string, direction: 'asc' | 'desc' }>,
default: () => ({})
},
sortMode: {
type: String as PropType<'manual' | 'auto'>,
default: 'auto'
},
sortButton: {
type: Object as PropType<Button>,
default: () => config.default.sortButton as Button
@@ -176,7 +180,7 @@ export default defineComponent({
const savedSort = { column: sort.value.column, direction: null }
const rows = computed(() => {
if (!sort.value?.column) {
if (!sort.value?.column || props.sortMode === 'manual') {
return props.rows
}