Header.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <template>
  2. <div class="header no-events">
  3. <div class="left">
  4. <div class="back yse-events" @click="goBack">
  5. <img src="@/assets/img/go_back.png" />
  6. <span>返回</span>
  7. </div>
  8. </div>
  9. <div class="center">
  10. <div class="title">{{title}}</div>
  11. </div>
  12. <div class="right">
  13. <slot name="right-slot"></slot>
  14. </div>
  15. </div>
  16. </template>
  17. <script setup>
  18. import { inject, onMounted, ref } from "vue";
  19. import { useStore } from "vuex";
  20. import { useRouter } from "vue-router";
  21. let emit = defineEmits(["goBack"]);
  22. let props = defineProps({
  23. title: {
  24. type: String,
  25. default:'飞鸟智慧果园管理平台'
  26. },
  27. });
  28. const store = useStore();
  29. const state = store.state;
  30. const router = useRouter();
  31. onMounted(() => {
  32. });
  33. /**
  34. * 返回按钮的事件
  35. */
  36. function goBack() {
  37. // emit("goBack");
  38. // router.go(1)
  39. // router.push('/home')
  40. router.push('/warningHome')
  41. }
  42. </script>
  43. <style lang="scss" scoped>
  44. .header {
  45. position: absolute;
  46. z-index: 1000;
  47. width: 100%;
  48. height: 80px;
  49. display: flex;
  50. flex-direction: row;
  51. justify-content: space-between;
  52. align-items: center;
  53. .left {
  54. height: 100%;
  55. display: flex;
  56. width: 32%;
  57. align-items: flex-end;
  58. margin-top: 20px;
  59. .back {
  60. background: #042b37;
  61. border-radius: 5px;
  62. border: 1px solid #00fff0;
  63. color: #fff;
  64. width: 94px;
  65. height: 36px;
  66. font-weight: 500;
  67. font-size: 19px;
  68. display: flex;
  69. align-items: center;
  70. justify-content: center;
  71. margin-left: 24px;
  72. cursor: pointer;
  73. img{
  74. width: 19px;
  75. height: 19px;
  76. margin-right: 8px;
  77. }
  78. }
  79. }
  80. .center {
  81. width: 50%;
  82. text-align: center;
  83. .title {
  84. width: 100%;
  85. text-align: center;
  86. height: 50px;
  87. font-size: 36px;
  88. font-family: PingFangSC-Semibold, PingFang SC;
  89. font-weight: 600;
  90. color: #5efcff;
  91. line-height: 50px;
  92. letter-spacing: 1px;
  93. background: linear-gradient(180deg, #5cf2ff 0%, #6cffd7 100%);
  94. -webkit-background-clip: text;
  95. -webkit-text-fill-color: transparent;
  96. }
  97. }
  98. .right {
  99. height: 100%;
  100. width: 33%;
  101. display: flex;
  102. flex-direction: row;
  103. align-items: flex-end;
  104. background-position: 0 100%;
  105. color: #fff;
  106. margin-top: 20px;
  107. }
  108. }
  109. </style>