Rental/layouts/default.vue
alsaze dc6ecdd223
All checks were successful
Deploy / build (push) Successful in 52s
init
2025-11-26 19:45:31 +03:00

73 lines
1.6 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<div class="layout">
<UHeader
title="Rental"
:toggle="false"
:ui="{
root: 'fixed bg-transparent w-full',
left: 'justify-between w-full',
container: 'gap-0',
right: 'hidden',
}"
>
<template #left>
<NuxtLink to="/">
Rental
</NuxtLink>
<UTabs v-model="activeTab" :content="false" :items="tabs" />
<UColorModeButton />
</template>
</UHeader>
<UMain>
<slot />
</UMain>
<UFooter>
<div class="flex flex-col md:flex-row justify-between items-center w-full text-sm opacity-70">
<div>
© {{ new Date().getFullYear() }} Rental. Все права защищены.
</div>
</div>
</UFooter>
</div>
</template>
<script setup lang="ts">
import type { TabsItem } from '@nuxt/ui'
import useScreen from '~/composables/useScreen'
const { isMobile } = useScreen()
const router = useRouter()
const route = useRoute()
const tabs = computed<TabsItem[]>(() => [
{
label: isMobile.value ? '' : 'Главная',
icon: 'i-lucide-home',
value: 'index',
route: '/',
},
{
label: isMobile.value ? '' : 'Недвижимость',
icon: 'i-lucide-building-2',
value: 'nedvizhimost',
route: '/nedvizhimost',
},
{
label: isMobile.value ? '' : 'Авто',
icon: 'i-lucide-car',
value: 'transport',
route: '/transport',
},
])
const activeTab = ref(route.path.split('/')[1])
watch(() => activeTab.value, () => {
const tab = tabs.value.find(tab => tab.value === activeTab.value)
router.push(tab.route)
})
</script>