headerInfo.vue 1011 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <template>
  2. <view :class="props.class" class="header_info"
  3. :style="{ height: appStore.navbarHeight + 'px',paddingTop: appStore.statusBarHeight + 'px'}"
  4. >
  5. <view class="isBack" >
  6. <u-icon name="arrow-left" :color="color" size="24" v-if="isBack" @click="goBack"></u-icon>
  7. <slot name="right"></slot>
  8. </view>
  9. <text class="font_size35 bold color_fff flex_1 text_align_center">{{title}}</text>
  10. </view>
  11. </template>
  12. <script setup>
  13. const props = defineProps({
  14. title: {
  15. type: String,
  16. default: "建材信息平台",
  17. },
  18. class: {
  19. type: String,
  20. default: 'flex-center',
  21. },
  22. isBack: {
  23. type: Boolean,
  24. default: false,
  25. },
  26. color: {
  27. type: String,
  28. default: '#ffffff',
  29. },
  30. });
  31. import { useAppStore } from "@/stores/app";
  32. const appStore = useAppStore();
  33. const goBack = () => {
  34. uni.navigateBack({
  35. delta: 1,
  36. });
  37. }
  38. </script>
  39. <style scoped lang="scss">
  40. .header_info{
  41. position: relative;
  42. .isBack{
  43. position: absolute;
  44. left: 0;
  45. bottom: 10px;
  46. }
  47. }
  48. </style>