JHeader.vue 953 B

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