headers.vue 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <template>
  2. <div style="width:100%;border-bottom: #f1f1f1 solid 1px;">
  3. <div class="header_box">
  4. <div class="header_left">
  5. <img src="../assets/image/resource/logo_img.png" class="logo_img" />
  6. <div class="header_list">
  7. <ul>
  8. <li v-for="items in navlist" class="nav_name"><a :href="items.url" style="color:#555;">{{items.name}}</a></li>
  9. </ul>
  10. </div>
  11. </div>
  12. <div class="header_right">
  13. <div class="helper" ><img src="../assets/image/resource/login_img.png" @click="tologin"/></div>
  14. </div>
  15. </div>
  16. </div>
  17. </template>
  18. <script>
  19. export default {
  20. data() {
  21. return {
  22. navlist: [
  23. { "id": 1, "name": '首页', "url": '/HomePage' },
  24. { "id": 2, "name": '资源', "url": '/resource' },
  25. { "id": 3, "name": '名师', "url": '/Teacher' },
  26. { "id": 4, "name": '活动', "url": '/activity' },
  27. ],
  28. }
  29. },
  30. methods: {
  31. tologin: function () {
  32. this.$router.push({ path: '/login' })
  33. }
  34. }
  35. }
  36. </script>
  37. <style scoped>
  38. .header_box {
  39. width: 1200px;
  40. height: 85px;
  41. background-color: #fff;
  42. margin: 0 auto;
  43. }
  44. .header_left {
  45. width: 800px;
  46. float: left;
  47. height: 75px;
  48. }
  49. .header_right {
  50. width: 215px;
  51. float: right;
  52. height: 75px;
  53. padding-left:5%;
  54. padding-top:5px;
  55. }
  56. .logo_img {
  57. float: left;
  58. width: 177px;
  59. height:41px;
  60. margin-top: 22px;
  61. }
  62. .header_list {
  63. float: left;
  64. width:70%;
  65. padding-left:15%;
  66. }
  67. .nav_name {
  68. width: 15%;
  69. float: left;
  70. list-style: none;
  71. display: block;
  72. height: 38px;
  73. line-height: 85px;
  74. padding: 0 5px;
  75. margin: 0 11px;
  76. font-size: 18px;
  77. color: #555555;
  78. text-align:center;
  79. }
  80. .login_btn {
  81. width:30%;
  82. display:block;
  83. float:left;
  84. margin-left:40%;
  85. }
  86. .helper {
  87. width: 100%;
  88. height:58px;
  89. display: block;
  90. float: left;
  91. padding-top:15px;
  92. }
  93. .helper img {
  94. width:100%;
  95. }
  96. </style>