header.vue 3.8 KB

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