hjyd
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

92 lines
2.0 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div
  3. :class="
  4. activeIndex == 0 ? 'header_container' : 'header_container not_first'
  5. "
  6. >
  7. <img :src="logo()" alt="logo" />
  8. <ul :class="fontColor()">
  9. <li><router-link to="/index">首页</router-link></li>
  10. <li><router-link to="/case">工业设计</router-link></li>
  11. <li><router-link to="/soft-hardware">软硬件研发</router-link></li>
  12. <li><router-link to="/culture">企业文化</router-link></li>
  13. <li><router-link to="/about">关于</router-link></li>
  14. <li><router-link to="/about">招聘</router-link></li>
  15. <li><router-link to="/contact">联系</router-link></li>
  16. </ul>
  17. </div>
  18. </template>
  19. <script setup>
  20. import Logo1 from '@/assets/img/banner/logo1.png'
  21. import Logo from '@/assets/img/banner/logo.png'
  22. import { useSwiperStore } from '@/store'
  23. import { onMounted, ref, watch } from 'vue'
  24. import { storeToRefs } from 'pinia'
  25. const swiperStore = useSwiperStore()
  26. const { activeIndex } = storeToRefs(swiperStore)
  27. const logo = () => {
  28. if (swiperStore.activeIndex == 0) {
  29. if ([4].includes(swiperStore.headerIndex)) return Logo1
  30. }
  31. return Logo
  32. }
  33. const fontColor = () => {
  34. if (swiperStore.activeIndex == 0) {
  35. if ([2, 3, 4].includes(swiperStore.headerIndex)) {
  36. return 'flex_center white'
  37. }
  38. }
  39. return 'flex_center font_change'
  40. }
  41. </script>
  42. <style scoped lang="scss">
  43. .header_container {
  44. position: fixed;
  45. top: 0;
  46. left: 0;
  47. right: 0;
  48. width: 100%;
  49. z-index: 999;
  50. background: none;
  51. padding: 0 87px;
  52. height: $header_height;
  53. white-space: nowrap;
  54. display: flex;
  55. align-items: center;
  56. justify-content: space-between;
  57. box-sizing: border-box;
  58. font-size: 18px;
  59. li {
  60. margin: 0 30px;
  61. }
  62. }
  63. .flex_center {
  64. display: flex;
  65. align-items: center;
  66. justify-content: center;
  67. li {
  68. a {
  69. color: $default_color;
  70. }
  71. .router-link-active {
  72. color: $theme_color;
  73. }
  74. .white {
  75. color: #fff;
  76. }
  77. }
  78. }
  79. .font_change {
  80. li {
  81. a {
  82. color: $point_default;
  83. }
  84. }
  85. }
  86. .not_first {
  87. background: #fff;
  88. }
  89. </style>