Navigation.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <!--
  2. Menu Navigation
  3. -->
  4. <template>
  5. <div v-intersect="onIntersect">
  6. <!-- Navigation (écran large) -->
  7. <div v-if="lgAndUp || (!isMobileDevice() && !nuxtReady)">
  8. <LayoutNavigationLg :menu="menu" />
  9. </div>
  10. <!-- Navigation (petit écran) -->
  11. <div v-else>
  12. <LayoutNavigationMd :menu="menu" />
  13. </div>
  14. </div>
  15. </template>
  16. <script setup lang="ts">
  17. import { useDisplay } from 'vuetify'
  18. import type { MainMenuItem } from '~/types/interface'
  19. import { useLayoutStore } from '~/stores/layoutStore'
  20. import { useClientDevice } from '~/composables/useClientDevice'
  21. // On force la version écran large au build côté serveur si l'écran fait plus de 1280px de large
  22. const nuxtReady = ref(false)
  23. onNuxtReady(() => {
  24. nuxtReady.value = true
  25. })
  26. const { lgAndUp } = useDisplay()
  27. const { isMobileDevice } = useClientDevice()
  28. const menu: Array<MainMenuItem> = [
  29. {
  30. label: 'Nos logiciels',
  31. children: [
  32. { label: 'Opentalent Artist', to: '/opentalent_artist' },
  33. { label: 'Opentalent School', to: '/opentalent_school' },
  34. { label: 'Opentalent Manager', to: '/opentalent_manager' },
  35. ],
  36. },
  37. {
  38. label: 'Nos services',
  39. children: [
  40. { label: 'Formations', to: '/formations' },
  41. { label: 'Webinaires', to: '/webinaires' },
  42. ],
  43. },
  44. {
  45. label: 'À propos',
  46. children: [
  47. { label: 'Qui sommes-nous', to: '/qui-sommes-nous' },
  48. { label: 'Nous rejoindre', to: '/nous-rejoindre' },
  49. ],
  50. },
  51. { label: 'Actualités', to: '/actualites' },
  52. { label: 'Contact', to: '/nous-contacter' },
  53. ]
  54. const layoutStore = useLayoutStore()
  55. const onIntersect = (isIntersecting: boolean) => {
  56. layoutStore.setIsHeaderVisible(isIntersecting)
  57. }
  58. </script>
  59. <style scoped></style>