index.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <template>
  2. <view :style="{ paddingTop: statusBarHeight + 'px' }"></view>
  3. <view v-if="navbarShow" style="margin-bottom: 44px">
  4. <u-navbar leftText="返回" :title="navbar_title" :safeAreaInsetTop="true">
  5. <template #left>
  6. <view class="u-nav-slot" style="display: flex">
  7. <u-icon name="arrow-left" size="19"></u-icon>
  8. <u-line direction="column" :hairline="false" length="16" margin="0 8px"></u-line>
  9. <u-icon name="home" size="20"></u-icon>
  10. </view>
  11. </template>
  12. </u-navbar>
  13. </view>
  14. </template>
  15. <script setup>
  16. import { onReady, onLoad, onShow, onNavigationBarButtonTap } from "@dcloudio/uni-app";
  17. import { ref, onMounted, inject, shallowRef, reactive, getCurrentInstance } from "vue";
  18. const props = defineProps({
  19. navbarShow: {
  20. type: Boolean,
  21. default: false,
  22. },
  23. navbarTitle: {
  24. type: String,
  25. default: "",
  26. },
  27. });
  28. const navbar_title = ref(props.navbarTitle);
  29. const navbar_show = ref(props.navbarShow);
  30. const statusBarHeight = ref(0);
  31. onLoad((option) => {
  32. let systemInfo = uni.getSystemInfoSync();
  33. statusBarHeight.value = systemInfo.statusBarHeight; //获取刘海屏高度
  34. });
  35. </script>