header.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <template>
  2. <nav class="client-head">
  3. <div class="client-container head-layout">
  4. <div class="head-left">
  5. <a :href="`${baseUrl}`" class="client-head-img"></a>
  6. <div @click="navChange">
  7. <el-menu
  8. :default-active="activeNav"
  9. :class="navClass"
  10. mode="horizontal"
  11. :router="false"
  12. >
  13. <template v-for="(item,index) in headerArr">
  14. <el-submenu :index="`${item.keyPath}`" v-if="item.children && item.children.length > 0"
  15. popper-class="mta-menu-two">
  16. <template slot="title">{{item.content}}</template>
  17. <el-menu-item :index="`${child.keyPath}`" v-for="child of item.children"
  18. :key="child.keyPath">
  19. <mtaLink :path="child.keyPath" :instation="true" :content="child.content"></mtaLink>
  20. </el-menu-item>
  21. </el-submenu>
  22. <el-menu-item :index="`${item.keyPath}`" v-else>
  23. <mtaLink :path="item.keyPath" :instation="true" :content="item.content"></mtaLink>
  24. </el-menu-item>
  25. </template>
  26. </el-menu>
  27. </div>
  28. <a class="phone-tel-box mta-hidden-sm" href="tel:400-052-2130">咨询电话:400-052-2130</a>
  29. <!-- 手机按钮 -->
  30. <div class="phone-nav-btn mta-hidden-sm" @click="changeHeadNav"></div>
  31. </div>
  32. <div class="head-right mta-hidden-xs">
  33. <a class="right-tel-btn">免费注册</a>
  34. <div class="system-box">
  35. <div>
  36. <a rel="nofollow" href="https://cdnks.mtavip.com/a/register?flug=1" target="_blank"><i></i><p>考试系统</p></a>
  37. <span></span>
  38. <a rel="nofollow" href="https://cdnks.mtavip.com/a/register?flug=2" target="_blank"><i></i><p>培训系统</p></a>
  39. </div>
  40. </div>
  41. <a rel="nofollow" href="https://cdnks.mtavip.com/a/registerLogin" target="_blank">登录</a>
  42. </div>
  43. </div>
  44. </nav>
  45. </template>
  46. <script>
  47. import mtaLink from '~/components/mtaLink/index';
  48. import { mapGetters } from 'vuex';
  49. let _ = require('lodash');
  50. export default {
  51. name: 'mtaHeader',
  52. components: {
  53. mtaLink,
  54. },
  55. computed: {
  56. activeNav() {
  57. return this.getActiveNav;
  58. },
  59. baseUrl() {
  60. return this.getBaseUrl;
  61. },
  62. ...mapGetters(['getActiveNav','getBaseUrl'])
  63. },
  64. data() {
  65. return {
  66. navClass:'head-nav-up',
  67. headerArr: [
  68. {
  69. content: '首页',
  70. keyPath: '/',
  71. },
  72. {
  73. content: '考试系统',
  74. keyPath: '/examsystem',
  75. children: [],
  76. },
  77. {
  78. content: '培训系统',
  79. keyPath: '/trainsystem',
  80. children: [],
  81. },
  82. /* {
  83. content: '课程资源',
  84. keyPath: '/resources',
  85. children: [],
  86. },*/
  87. {
  88. content: '体验中心',
  89. keyPath: '/tiyanCenter',
  90. children: [],
  91. },
  92. {
  93. content: '课程开发',
  94. keyPath: '/courseware',
  95. children: [],
  96. },
  97. {
  98. content: '客户案例',
  99. keyPath: '/news',
  100. children: [],
  101. },
  102. /* {
  103. content: '帮助中心',
  104. keyPath: '/helpCenter',
  105. children: [],
  106. },*/
  107. {
  108. content: '关于我们',
  109. keyPath: '/introduction',
  110. children: [],
  111. },
  112. ],
  113. };
  114. },
  115. methods:{
  116. // 点击按钮菜单变化
  117. changeHeadNav(){
  118. if(this.navClass ==='head-nav-up' ){
  119. this.navClass = 'head-nav-down'
  120. }else{
  121. this.navClass = 'head-nav-up'
  122. }
  123. },
  124. navChange(){
  125. this.navClass = 'head-nav-up'
  126. },
  127. },
  128. };
  129. </script>