navbar.vue 658 B

1234567891011121314151617181920212223242526
  1. <route lang="json5">
  2. {
  3. style: { navigationBarTitleText: '自定义导航栏', navigationStyle: 'custom' },
  4. }
  5. </route>
  6. <template>
  7. <fly-navbar />
  8. <view class="bg-green-300 min-h-20" :style="{ paddingTop: safeAreaInsets?.top + 'px' }">
  9. <view class="p-4"> 自定义导航栏,设置"navigationStyle":"custom" </view>
  10. <view class="p-4"> 通常页面顶部有一个图片或背景色 </view>
  11. </view>
  12. <fly-content :line="20" />
  13. </template>
  14. <route lang="json5">
  15. {
  16. style: { navigationStyle: 'custom' },
  17. }
  18. </route>
  19. <script lang="ts" setup>
  20. // 获取屏幕边界到安全区域距离
  21. const { safeAreaInsets } = uni.getSystemInfoSync()
  22. </script>