HeaderMain.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <template>
  2. <div class="header">
  3. <div class="logo" @click="home">
  4. <img class="logo-img" src="../assets/images/diaoyanbao-log.png" alt="">调研宝</div>
  5. <div class="right">
  6. <div class="operational-data" @click="testData">查看数据</div>
  7. <el-dropdown placement="bottom" trigger="click">
  8. <div class="userinfo">用户名 <i class="el-icon-caret-bottom"></i></div>
  9. <el-dropdown-menu slot="dropdown">
  10. <el-dropdown-item>退出</el-dropdown-item>
  11. </el-dropdown-menu>
  12. </el-dropdown>
  13. </div>
  14. </div>
  15. </template>
  16. <script>
  17. export default {
  18. data() {
  19. return {};
  20. },
  21. methods: {
  22. home() {
  23. this.$router.push({ path: "/" });
  24. },
  25. testData() {
  26. this.$router.push({ path: "/testData" });
  27. }
  28. }
  29. };
  30. </script>
  31. <style lang="less" scoped>
  32. .header {
  33. z-index: 1;
  34. position: fixed;
  35. top: 0px;
  36. width: 100%;
  37. height: 60px;
  38. box-shadow: 0 2px 8px 0 rgba(62, 67, 116, 0.1);
  39. border-bottom: 0;
  40. display: flex;
  41. flex-direction: row;
  42. justify-content: space-between;
  43. align-items: center;
  44. padding: 0px 50px;
  45. .logo {
  46. display: flex;
  47. flex-direction: row;
  48. line-height: 30px;
  49. cursor: pointer;
  50. .logo-img {
  51. width: 30px;
  52. height: 30px;
  53. margin-right: 6px;
  54. border-radius: 15px;
  55. }
  56. }
  57. .right {
  58. display: flex;
  59. flex-direction: row;
  60. .operational-data {
  61. width: 119px;
  62. height: 34px;
  63. background: #e6edff;
  64. border-radius: 17px;
  65. font-size: 16px;
  66. color: #4e5dff;
  67. line-height: 34px;
  68. text-align: center;
  69. margin-right: 46px;
  70. cursor: pointer;
  71. }
  72. .userinfo {
  73. width: 132px;
  74. height: 34px;
  75. line-height: 34px;
  76. text-align: center;
  77. margin-right: 22px;
  78. }
  79. }
  80. }
  81. </style>