headers.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <template>
  2. <div class="headerContainer">
  3. <div class="header center-row">
  4. <img src="http://ttkt.sxedu.org:70/upload/setting/0/0.png?_=1557194799800" />
  5. <ul>
  6. <li :class="activeIndex == 0 ? 'li-active':''" @click="handleMenuClick(0,'index')">首页</li>
  7. <li :class="activeIndex == 1 ? 'li-active':''" @click="handleMenuClick(1,'notice')">通知公告</li>
  8. <li :class="activeIndex == 2 ? 'li-active':''" @click="handleMenuClick(2,'reviewActivity')">评审活动</li>
  9. <li :class="activeIndex == 3 ? 'li-active':''" @click="handleMenuClick(3,'PastReview')">往届回顾</li>
  10. <li :class="activeIndex == 4 ? 'li-active':''" @click="handleMenuClick(4,'LiveBroadcast')">天天直播</li>
  11. <li :class="activeIndex == 5 ? 'li-active':''" @click="handleMenuClick(5,'Lessons')">优课汇聚</li>
  12. </ul>
  13. <span class="btn-login">登录</span>
  14. </div>
  15. </div>
  16. </template>
  17. <script>
  18. export default {
  19. name: "headers",
  20. props: ['parentToChild', 'identityselect'],
  21. data() {
  22. return {
  23. activeIndex:0
  24. }
  25. },
  26. created() {
  27. },
  28. methods: {
  29. handleMenuClick(index, route) {
  30. this.activeIndex = index;
  31. this.$router.push(route);
  32. }
  33. },
  34. }
  35. </script>
  36. <style>
  37. .headerContainer {
  38. background-color: #1f2d3d;
  39. height: 80px;
  40. position: absolute;
  41. min-width: 100%
  42. }
  43. .header {
  44. width: 1200px;
  45. margin: 0 auto;
  46. height: 80px;
  47. box-sizing: content-box
  48. }
  49. .header ul {
  50. list-style:none;
  51. color:#aaa;
  52. padding: 0 20px;
  53. margin-right:160px;
  54. }
  55. .header ul li {
  56. float:left;
  57. height:80px;
  58. width:100px;
  59. line-height:80px;
  60. text-align:center;
  61. padding: 0 15px;
  62. font-size:16px;
  63. cursor:pointer;
  64. }
  65. .header ul li:hover {
  66. background:rgba(160,160,160,.24);
  67. color:#33aafe;
  68. }
  69. .header ul .li-active {
  70. color:#33aafe;
  71. }
  72. .header .btn-login {
  73. color: #fff;
  74. font-size: 14px;
  75. line-height: 44px;
  76. display: inline-block;
  77. cursor:pointer;
  78. }
  79. .center-row {
  80. display:flex;
  81. flex-direction:row;
  82. align-items:center;
  83. justify-content:space-around;
  84. }
  85. </style>