headers.vue 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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: 30%;
  59. margin-top: 2%;
  60. }
  61. .header_list {
  62. float: left;
  63. width:70%;
  64. padding-left:15%;
  65. }
  66. .nav_name {
  67. width: 15%;
  68. float: left;
  69. list-style: none;
  70. display: block;
  71. height: 38px;
  72. line-height: 85px;
  73. padding: 0 5px;
  74. margin: 0 11px;
  75. font-size: 18px;
  76. color: #555555;
  77. text-align:center;
  78. }
  79. .login_btn {
  80. width:30%;
  81. display:block;
  82. float:left;
  83. margin-left:40%;
  84. }
  85. .helper {
  86. width: 100%;
  87. height:58px;
  88. display: block;
  89. float: left;
  90. padding-top:15px;
  91. }
  92. .helper img {
  93. width:100%;
  94. }
  95. </style>