topVisual.vue 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <template>
  2. <section id="top--visual" :class="className">
  3. <div class="inner--content">
  4. <h1>{{ title }}</h1>
  5. <nav>
  6. <ul>
  7. <li>
  8. <NuxtLink to="/">
  9. <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">
  10. <mask id="mask0_127_65147" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="20" height="20">
  11. <rect width="20" height="20" fill="#D9D9D9"/>
  12. </mask>
  13. <g mask="url(#mask0_127_65147)">
  14. <path d="M3.75 17.0833V7.70833L10 3L16.25 7.70833V17.0833H11.5833V11.5H8.41667V17.0833H3.75Z" fill="white"/>
  15. </g>
  16. </svg>
  17. </NuxtLink>
  18. </li>
  19. <li v-for="(nav, index) in navigation" :key="nav.name" @mouseenter="showDropdown(index)" @mouseleave="hideDropdown">
  20. <NuxtLink :to="nav.link">{{ nav.name }}
  21. <i v-if="nav.gnbList" :class="{ 'active': openDropdown === index }">
  22. <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">
  23. <mask id="mask0_127_68809" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="20" height="20">
  24. <rect width="20" height="20" fill="#D9D9D9"/>
  25. </mask>
  26. <g mask="url(#mask0_127_68809)">
  27. <path d="M9.99935 12.9372L5.29102 8.20801L6.16602 7.33301L9.99935 11.1663L13.8327 7.33301L14.7077 8.20801L9.99935 12.9372Z" fill="white"/>
  28. </g>
  29. </svg>
  30. </i>
  31. </NuxtLink>
  32. <ul v-if="nav.gnbList" :class="{ 'show': openDropdown === index }">
  33. <li v-for="gnb in nav.gnbList" :key="gnb.name">
  34. <NuxtLink :to="gnb.link">{{ gnb.name }}</NuxtLink>
  35. </li>
  36. </ul>
  37. </li>
  38. </ul>
  39. </nav>
  40. </div>
  41. </section>
  42. </template>
  43. <script>
  44. export default {
  45. name: 'TopVisual',
  46. props: {
  47. className: {
  48. type: String,
  49. required: true
  50. },
  51. title: {
  52. type: String,
  53. required: true
  54. },
  55. navigation: {
  56. type: Array,
  57. required: true
  58. }
  59. },
  60. data() {
  61. return {
  62. openDropdown: null
  63. }
  64. },
  65. methods: {
  66. showDropdown(index) {
  67. this.openDropdown = index;
  68. },
  69. hideDropdown() {
  70. this.openDropdown = null;
  71. }
  72. }
  73. }
  74. </script>