index.vue 791 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <template>
  2. <!-- 头部占位 -->
  3. <view>
  4. <!-- #ifdef APP-PLUS || MP -->
  5. <view class="sys-head" :style="{height:sysHeight}"></view>
  6. <!-- #endif -->
  7. <!-- #ifdef MP || APP-PLUS -->
  8. <view class="sys-title">{{title}}</view>
  9. <!-- #endif -->
  10. </view>
  11. </template>
  12. <script>
  13. let sysHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
  14. export default {
  15. props: {
  16. title:{
  17. type:String,
  18. default:''
  19. }
  20. },
  21. data() {
  22. return {
  23. sysHeight: sysHeight
  24. }
  25. },
  26. }
  27. </script>
  28. <style scoped>
  29. .sys-title {
  30. z-index: 10;
  31. position: relative;
  32. height: 40px;
  33. line-height: 40px;
  34. font-size: 30rpx;
  35. color: #fff;
  36. background-color: var(--view-theme);
  37. // #ifdef MP || APP-PLUS
  38. text-align: center;
  39. // #endif
  40. }
  41. .sys-head {
  42. background-color: #fff;
  43. }
  44. </style>