From d4859cf30971fa2b6c8c533c1d3e0dd13f0d5397 Mon Sep 17 00:00:00 2001 From: Mathieu NICOLAS <65437872+mathieunicolas@users.noreply.github.com> Date: Fri, 14 Jul 2023 22:01:12 +0200 Subject: [PATCH] Update Table.vue --- src/runtime/components/data/Table.vue | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/runtime/components/data/Table.vue b/src/runtime/components/data/Table.vue index 1b5153cc7d..d68d99bf39 100644 --- a/src/runtime/components/data/Table.vue +++ b/src/runtime/components/data/Table.vue @@ -111,6 +111,10 @@ export default defineComponent({ type: Object as PropType>, default: () => appConfig.ui.table.default.sortButton }, + sortingFunction: { + type: Function, + default: null + }, sortAscIcon: { type: String, default: () => appConfig.ui.table.default.sortAscIcon @@ -154,7 +158,11 @@ export default defineComponent({ const { column, direction } = sort.value - return orderBy(props.rows, column, direction) + if(!props.sortingFunction) { + return orderBy(props.rows, column, direction) + } else { + return props.sortingFunction(column, direction) + } }) const selected = computed({