Todo app
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

18 lines
526 B

<template>
adasda
<Column field="title">
<template #header>
<span @click="toggleSorting('title')" class="p-datatable-column-title">Title&nbsp;
<span :class="['pi', sorting.title === 'asc' ? 'pi-arrow-circle-down' : 'pi-arrow-circle-up']"></span>
</span>
</template>
</Column>
</template>
<script setup lang="ts">
const sorting = defineModel<Record<string, string>>({ required: true });
function toggleSorting(key: string) {
sorting.value[key] = sorting.value[key] === 'asc' ? 'desc' : 'asc';
};
</script>