JHeader.vue 809 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <template>
  2. <view class="j-header-container">
  3. <JBack v-bind="$attrs" :dark="dark"></JBack>
  4. <view
  5. class="title" :style="{
  6. color: !dark ? '#fff' : ''
  7. }"
  8. >
  9. {{ title }}
  10. </view>
  11. <view class="footerFn">
  12. <slot name="ftFn"></slot>
  13. </view>
  14. </view>
  15. </template>
  16. <script>
  17. export default {
  18. name: 'JHeader',
  19. props: {
  20. dark: {
  21. type: Boolean,
  22. default: true
  23. },
  24. title: {
  25. type: String,
  26. required: true
  27. }
  28. }
  29. }
  30. </script>
  31. <style lang="less" scoped>
  32. .j-header-container {
  33. position: relative;
  34. display: flex;
  35. justify-content: space-between;
  36. align-items: center;
  37. .title {
  38. font-size: 32upx;
  39. color: #3d3d3d;
  40. font-weight: bold;
  41. // margin-top: -8upx;
  42. flex: 1;
  43. text-align: center;
  44. margin-left: -50upx;
  45. }
  46. .footerFn {
  47. position: absolute;
  48. right: 0rpx;
  49. }
  50. }
  51. </style>