Header.vue 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <template>
  2. <div id="header">
  3. <div class="logo">青浦一张图</div>
  4. <div class="userdropdown">
  5. <User />
  6. </div>
  7. <div class="menu">
  8. <ul class="menu_ul">
  9. <li
  10. v-for="item in $store.state.menuList"
  11. :key="item.path"
  12. :class="{ active: $route.path == item.path }"
  13. @click="$router.push(item.path)"
  14. >
  15. {{ item.label }}
  16. </li>
  17. </ul>
  18. </div>
  19. <el-dialog v-model="dialogLoginVisible" width="500">
  20. <Login :close="closeLoginDialog" />
  21. </el-dialog>
  22. </div>
  23. </template>
  24. <script>
  25. import User from "@/components/user/user.vue";
  26. export default {
  27. components: {
  28. User,
  29. },
  30. data() {
  31. return {
  32. };
  33. },
  34. mounted() {},
  35. methods: {
  36. },
  37. };
  38. </script>
  39. <style lang="less" scoped>
  40. #header {
  41. width: 100vw;
  42. height: 70px;
  43. background: linear-gradient(180deg, #2c2f74, #494d98);
  44. color: #ffffff;
  45. margin: 0 auto;
  46. .logo {
  47. display: inline-block;
  48. height: 70px;
  49. width: 200px;
  50. text-align: center;
  51. line-height: 70px;
  52. font-size: 24px;
  53. }
  54. .menu {
  55. display: inline-block;
  56. float: right;
  57. .menu_ul {
  58. li {
  59. display: inline-block;
  60. height: 50px;
  61. width: fit-content;
  62. line-height: 50px;
  63. text-align: center;
  64. cursor: pointer;
  65. margin: 10px 20px;
  66. font-size: 20px;
  67. font-weight: bold;
  68. }
  69. li:hover {
  70. color: #00bbff;
  71. }
  72. li.active {
  73. color: #00bbff;
  74. }
  75. }
  76. }
  77. }
  78. .userdropdown {
  79. float: right;
  80. width: 150px;
  81. display: flex;
  82. align-items: center;
  83. height: 70px;
  84. justify-content: center;
  85. cursor: pointer;
  86. border: 0;
  87. }
  88. </style>