3
0

header.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <template>
  2. <view class="u-calendar-header u-border-bottom">
  3. <text
  4. class="u-calendar-header__title"
  5. v-if="showTitle"
  6. >{{ title }}</text>
  7. <text
  8. class="u-calendar-header__subtitle"
  9. v-if="showSubtitle"
  10. >{{ subtitle }}</text>
  11. <view class="u-calendar-header__weekdays">
  12. <text class="u-calendar-header__weekdays__weekday">一</text>
  13. <text class="u-calendar-header__weekdays__weekday">二</text>
  14. <text class="u-calendar-header__weekdays__weekday">三</text>
  15. <text class="u-calendar-header__weekdays__weekday">四</text>
  16. <text class="u-calendar-header__weekdays__weekday">五</text>
  17. <text class="u-calendar-header__weekdays__weekday">六</text>
  18. <text class="u-calendar-header__weekdays__weekday">日</text>
  19. </view>
  20. </view>
  21. </template>
  22. <script>
  23. import { mpMixin } from '../../libs/mixin/mpMixin';
  24. import { mixin } from '../../libs/mixin/mixin';
  25. export default {
  26. name: 'u-calendar-header',
  27. mixins: [mpMixin, mixin],
  28. props: {
  29. // 标题
  30. title: {
  31. type: String,
  32. default: ''
  33. },
  34. // 副标题
  35. subtitle: {
  36. type: String,
  37. default: ''
  38. },
  39. // 是否显示标题
  40. showTitle: {
  41. type: Boolean,
  42. default: true
  43. },
  44. // 是否显示副标题
  45. showSubtitle: {
  46. type: Boolean,
  47. default: true
  48. },
  49. },
  50. data() {
  51. return {
  52. }
  53. },
  54. methods: {
  55. name() {
  56. }
  57. },
  58. }
  59. </script>
  60. <style lang="scss" scoped>
  61. @import "../../libs/css/components.scss";
  62. .u-calendar-header {
  63. display: flex;
  64. flex-direction: column;
  65. padding-bottom: 4px;
  66. &__title {
  67. font-size: 16px;
  68. color: $u-main-color;
  69. text-align: center;
  70. height: 42px;
  71. line-height: 42px;
  72. font-weight: bold;
  73. }
  74. &__subtitle {
  75. font-size: 14px;
  76. color: $u-main-color;
  77. height: 40px;
  78. text-align: center;
  79. line-height: 40px;
  80. font-weight: bold;
  81. }
  82. &__weekdays {
  83. @include flex;
  84. justify-content: space-between;
  85. &__weekday {
  86. font-size: 13px;
  87. color: $u-main-color;
  88. line-height: 30px;
  89. flex: 1;
  90. text-align: center;
  91. }
  92. }
  93. }
  94. </style>