Skip to content

Commit

Permalink
#499 minor formatting fixes for sub page selector
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtavis committed Nov 15, 2023
1 parent 6598ad3 commit b6502de
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions frontend/components/page/PageSubPageSelector.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<template>
<div class="w-full h-fit">
<TabGroup v-model="currentTabIndex"
@change="changeTab"
manual
:default-index="defaultIndex"
<TabGroup
v-model="currentTabIndex"
@change="changeTab"
manual
:default-index="defaultIndex"
>
<TabList class="flex flex-row">
<Tab v-for="selector in selectors" :key="selector.id" class="w-full">
<template v-slot="{ selected }">
<template #default="{ selected }">
<NuxtLink
:class="[
'justify-center flex px-3 py-1 border-l-[1px] border-y-[1px] w-full',
Expand All @@ -20,17 +21,17 @@
>
{{ selector.label }}
</NuxtLink>
</template>
</template>
</Tab>
</TabList>
</TabGroup>
</div>
</template>

<script setup lang="ts">
import { computed } from 'vue';
import { Tab, TabList, TabGroup } from '@headlessui/vue';
import { SubPageSelector } from '~/types/sub-page-selector';
import { Tab, TabGroup, TabList } from "@headlessui/vue";
import { computed } from "vue";
import { SubPageSelector } from "~/types/sub-page-selector";
const localePath = useLocalePath();
const router = useRouter();
Expand All @@ -41,7 +42,7 @@ const props = defineProps<{
}>();
const defaultIndex = computed(() => {
return props.selectors.findIndex(selector => selector.selected) || 0;
return props.selectors.findIndex((selector) => selector.selected) || 0;
});
function changeTab(index: number) {
Expand Down

0 comments on commit b6502de

Please sign in to comment.