v-header.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <template>
  2. <!--头部-->
  3. <div class="header">
  4. <Clock></Clock>
  5. <!--中间LOGO -->
  6. <a class="title" href="/integrated/index" >
  7. <!-- <img src="@/assets/images/integrated/bigdata-header-nav-left2.png" /> -->
  8. <h3><img class="logo" src="@/assets/images/integrated/logo-small.png" />四平市态势感知平台 {{titlename}}
  9. </h3>
  10. <!-- <img src="@/assets/images/integrated/bigdata-header-nav-right2.png" /> -->
  11. </a>
  12. <!--中间导航-->
  13. <div class="bignav">
  14. <img src="@/assets/images/integrated/bigdata-header-nav-left2.png" />
  15. <router-link v-for="(navbar,index) in navbar" :key="index+'1'" :to="navbar.path" class="bignav-list"
  16. exact>
  17. <a>{{navbar.meta.title}}</a>
  18. </router-link>
  19. <img src="@/assets/images/integrated/bigdata-header-nav-right2.png" />
  20. </div>
  21. <!-- 右侧5个中心 -->
  22. <VfastMenu></VfastMenu>
  23. </div>
  24. </template>
  25. <script>
  26. import {constantRoutes} from '@/router/index'//navbar导航引用了router路由的数组
  27. import Clock from '@/components/clock.vue' // 时钟+天气
  28. import VfastMenu from '@/components/v-fastmenu.vue' // 头部右侧菜单
  29. export default{
  30. components:{
  31. VfastMenu,
  32. Clock
  33. },
  34. created(){
  35. this.navbar
  36. },
  37. data(){
  38. return{
  39. }
  40. },
  41. methods:{
  42. },
  43. computed:{
  44. titlename(){
  45. return this.$route.meta.title
  46. },
  47. //导航菜单
  48. navbar(){
  49. return constantRoutes.slice(1)
  50. },
  51. },
  52. }
  53. </script>
  54. <style rel="stylesheet/scss" lang="scss" scoped>
  55. @import '@/assets/styles/base.scss';
  56. .header {
  57. width: 100%;
  58. background: #a7ec12;
  59. background: url(../assets/images/visual/header.png) no-repeat center center;
  60. background-size: cover;
  61. height: 4rem;
  62. display: flex;
  63. align-items: center;
  64. z-index: 1000;
  65. position: absolute;
  66. top: 0;
  67. .title {
  68. display: flex;
  69. position: fixed;
  70. left: 50%;
  71. transform: translateX(-50%);
  72. h3 {
  73. display: flex;
  74. align-items: center;
  75. text-align: center;
  76. color: $white;
  77. font-size: 1.8rem;
  78. font-family: $fontFk;
  79. img {
  80. margin-right: .5rem;
  81. }
  82. }
  83. }
  84. .bignav {
  85. height: 40px;
  86. position: fixed;
  87. left: 50%;
  88. transform: translateX(-50%);
  89. top: 3.9rem;
  90. z-index: 1000;
  91. border-radius: 5px;
  92. display: flex;
  93. justify-content: cetner;
  94. align-items: center;
  95. .bignav-list {
  96. background: url(../assets/images/integrated/bigdata-header-nav-re2.png) repeat-x center;
  97. float: left;
  98. display: flex;
  99. justify-content: cetner;
  100. align-items: center;
  101. color: $fListTitle;
  102. height: 40px;
  103. font-size: 12px;
  104. padding: 0 23px;
  105. cursor: pointer;
  106. -webkit-transform: translateY(0);
  107. transform: translateY(0);
  108. transition: all 0.3s ease-in-out;
  109. }
  110. .router-link-active,
  111. .bignav-list:hover {
  112. filter: brightness(2.3);
  113. -webkit-transform: translateY(-1px);
  114. transform: translateY(-1px);
  115. color: $inBlueHover;
  116. border-bottom: 1px solid $inBlueHover;
  117. transition: all 0.3s ease-in-out;
  118. }
  119. }
  120. }
  121. </style>