PageTitle.unuse 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <template>
  2. <view>
  3. <view v-if="useCustomNav" class="custom-nav">
  4. <view class="nav-title">{{ title }}</view>
  5. </view>
  6. <view class="text-area">
  7. <text class="title">{{ title }}</text>
  8. </view>
  9. </view>
  10. </template>
  11. <script setup lang="ts">
  12. import { defineProps } from 'vue'
  13. const props = defineProps({
  14. title: { type: String, required: true },
  15. useCustomNav: { type: Boolean, default: false }
  16. })
  17. const title = props.title
  18. const useCustomNav = props.useCustomNav
  19. </script>
  20. <style scoped>
  21. .text-area {
  22. display: flex;
  23. justify-content: center;
  24. align-items: center;
  25. margin-top: 40rpx;
  26. }
  27. .title {
  28. font-size: 36rpx;
  29. color: #8f8f94;
  30. font-weight: 400;
  31. }
  32. .custom-nav {
  33. position: fixed;
  34. left: 0;
  35. right: 0;
  36. top: 0;
  37. height: 88rpx;
  38. padding-top: constant(safe-area-inset-top);
  39. padding-top: env(safe-area-inset-top);
  40. background-color: #fff;
  41. display: flex;
  42. align-items: center;
  43. justify-content: center;
  44. z-index: 1000;
  45. border-bottom: 1rpx solid #eee;
  46. }
  47. .nav-title {
  48. font-size: 34rpx;
  49. font-weight: bold;
  50. color: #333;
  51. }
  52. </style>