| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- <!--
- Menu Navigation
- -->
- <template>
- <div v-intersect="onIntersect">
- <!-- Navigation (écran large) -->
- <div v-if="lgAndUp || (isLargeScreen && !nuxtReady)">
- <LayoutNavigationLg :menu="menu" />
- </div>
- <!-- Navigation (petit écran) -->
- <div v-else>
- <LayoutNavigationMd :menu="menu" />
- </div>
- </div>
- </template>
- <script setup lang="ts">
- import { useDisplay } from 'vuetify'
- import type { MainMenuItem } from '~/types/interface'
- import { useLayoutStore } from '~/stores/layoutStore'
- // Get the initial width (useDisplay won't work during SSR)
- const isLargeScreen =
- ((typeof window === 'undefined' && 1024) ||
- window.innerWidth ||
- document.documentElement.clientWidth ||
- document.body.clientWidth) >= 1280
- // On force la version écran large au build côté serveur si l'écran fait plus de 1280px de large
- const nuxtReady = ref(false)
- onNuxtReady(() => {
- nuxtReady.value = true
- })
- const { lgAndUp } = useDisplay()
- const menu: Array<MainMenuItem> = [
- {
- label: 'Nos logiciels',
- children: [
- { label: 'Opentalent Artist', to: '/opentalent_artist' },
- { label: 'Opentalent School', to: '/opentalent_school' },
- { label: 'Opentalent Manager', to: '/opentalent_manager' },
- ],
- },
- {
- label: 'Nos services',
- children: [
- { label: 'Formations', to: '/formations' },
- { label: 'Webinaires', to: '/webinaires' },
- ],
- },
- {
- label: 'À propos',
- children: [
- { label: 'Qui sommes-nous', to: '/qui-sommes-nous' },
- { label: 'Nous rejoindre', to: '/nous-rejoindre' },
- ],
- },
- { label: 'Actualités', to: '/actualites' },
- { label: 'Contact', to: '/nous-contacter' },
- ]
- const layoutStore = useLayoutStore()
- const onIntersect = (isIntersecting: boolean) => {
- layoutStore.setIsHeaderVisible(isIntersecting)
- }
- </script>
- <style scoped></style>
|