DemoPage.vue 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <script setup lang="ts">
  2. import CommonRoot from '../dialog/CommonRoot.vue';
  3. const props = defineProps({
  4. title: String,
  5. desc: String
  6. })
  7. if (props.title) {
  8. uni.setNavigationBarTitle({
  9. title: props.title,
  10. })
  11. }
  12. </script>
  13. <template>
  14. <CommonRoot>
  15. <view class="nana-demo-page">
  16. <view class="header">
  17. <text class="title">{{ title }}</text>
  18. <text v-if="desc" class="desc">{{ desc }}</text>
  19. </view>
  20. <slot />
  21. </view>
  22. </CommonRoot>
  23. </template>
  24. <style>
  25. .nana-demo-page {
  26. display: flex;
  27. flex-direction: column;
  28. background-color: #efefef;
  29. /* #ifdef H5 */
  30. min-height: calc(100vh - 44px - env(safe-area-inset-top));
  31. /* #endif */
  32. /* #ifndef H5 */
  33. min-height: calc(100vh - 44px);
  34. /* #endif */
  35. }
  36. .nana-demo-page > .header {
  37. display: flex;
  38. flex-direction: column;
  39. margin: 40rpx 40rpx;
  40. flex-shrink: 0;
  41. }
  42. .nana-demo-page > .header .title {
  43. font-size: 45rpx;
  44. font-weight: bold;
  45. color: #0079db;
  46. }
  47. .nana-demo-page > .header .desc {
  48. font-size: 28rpx;
  49. color: #888;
  50. margin-top: 15rpx;
  51. }
  52. </style>