All files / src/components/navigation/mcad McadToggleSortBtn.vue

100% Statements 5/5
100% Branches 4/4
100% Functions 3/3
100% Lines 5/5

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33          3x           32x                         32x 32x     3x        
<template>
  <v-btn
    color="primary"
    size="x-small"
    variant="text"
    @click="toggleSort()"
  >
    <v-icon
      class="minsk-500"
      icon="swap_vert"
      start
    />
    <span
      class="minsk-900"
      style="font-size: 12px !important"
      >{{ t('labels.sort') }}</span
    >
  </v-btn>
</template>
 
<script setup lang="ts">
import { useMcadStore } from '@/stores/mcad.store';
import { useI18n } from 'vue-i18n';
 
const { t } = useI18n();
const mcadStore = useMcadStore();
 
async function toggleSort(): Promise<void> {
  mcadStore.sortBy[0].order =
    mcadStore.sortBy[0].order === 'asc' ? 'desc' : 'asc';
}
</script>