header.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <template>
  2. <nav class="client-head">
  3. <div class="client-container head-layout">
  4. <div class="head-left">
  5. <a :href="`${baseUrl}`"></a>
  6. <el-menu
  7. :default-active="activeNav"
  8. class="el-menu-demo"
  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. </div>
  27. <div class="head-right">
  28. <a class="right-tel-btn">免费注册</a>
  29. <div class="system-box">
  30. <div>
  31. <a href="https://cdnks.mtavip.com/a/register?flug=1" target="_blank"><i></i><p>考试系统</p></a>
  32. <span></span>
  33. <a href="https://cdnks.mtavip.com/a/register?flug=2" target="_blank"><i></i><p>培训系统</p></a>
  34. </div>
  35. </div>
  36. <a rel="nofollow" href="https://cdnks.mtavip.com/a/register?flug=1" target="_blank">登录</a>
  37. </div>
  38. </div>
  39. </nav>
  40. </template>
  41. <script>
  42. import mtaLink from '~/components/mtaLink/index';
  43. import { mapGetters } from 'vuex';
  44. let _ = require('lodash');
  45. export default {
  46. name: 'mtaHeader',
  47. components: {
  48. mtaLink,
  49. },
  50. computed: {
  51. activeNav() {
  52. return this.getActiveNav;
  53. },
  54. baseUrl() {
  55. return this.getBaseUrl;
  56. },
  57. ...mapGetters(['getActiveNav','getBaseUrl'])
  58. },
  59. data() {
  60. return {
  61. headerArr: [
  62. {
  63. content: '首页',
  64. keyPath: '/',
  65. },
  66. {
  67. content: '考试系统',
  68. keyPath: '/examsystem',
  69. children: [],
  70. },
  71. {
  72. content: '培训系统',
  73. keyPath: '/trainsystem',
  74. children: [],
  75. },
  76. {
  77. content: '课程开发',
  78. keyPath: '/courseware',
  79. children: [],
  80. },
  81. {
  82. content: '新闻资讯',
  83. keyPath: '/news',
  84. children: [],
  85. },
  86. /* {
  87. content: '帮助中心',
  88. keyPath: '/helpCenter',
  89. children: [],
  90. },*/
  91. {
  92. content: '关于我们',
  93. keyPath: '/introduction',
  94. children: [],
  95. },
  96. ],
  97. };
  98. },
  99. };
  100. </script>