calendar.wxml 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <view class="van-calendar">
  2. <header
  3. title="{{ title }}"
  4. showTitle="{{ showTitle }}"
  5. subtitle="{{ subtitle }}"
  6. showSubtitle="{{ showSubtitle }}"
  7. firstDayOfWeek="{{ firstDayOfWeek }}"
  8. bind:click-subtitle="onClickSubtitle"
  9. >
  10. <slot name="title" slot="title"></slot>
  11. </header>
  12. <scroll-view
  13. class="van-calendar__body"
  14. scroll-y
  15. scroll-into-view="{{ scrollIntoView }}"
  16. >
  17. <month
  18. wx:for="{{ computed.getMonths(minDate, maxDate) }}"
  19. wx:key="index"
  20. id="month{{ index }}"
  21. class="month"
  22. data-date="{{ item }}"
  23. date="{{ item }}"
  24. type="{{ type }}"
  25. color="{{ color }}"
  26. minDate="{{ minDate }}"
  27. maxDate="{{ maxDate }}"
  28. showMark="{{ showMark }}"
  29. formatter="{{ formatter }}"
  30. rowHeight="{{ rowHeight }}"
  31. currentDate="{{ currentDate }}"
  32. showSubtitle="{{ showSubtitle }}"
  33. allowSameDay="{{ allowSameDay }}"
  34. showMonthTitle="{{ index !== 0 || !showSubtitle }}"
  35. firstDayOfWeek="{{ firstDayOfWeek }}"
  36. bind:click="onClickDay"
  37. />
  38. </scroll-view>
  39. <view
  40. class="{{ utils.bem('calendar__footer', { safeAreaInsetBottom }) }}"
  41. >
  42. <slot name="footer"></slot>
  43. </view>
  44. <view
  45. class="{{ utils.bem('calendar__footer', { safeAreaInsetBottom }) }}"
  46. >
  47. <van-button
  48. wx:if="{{ showConfirm }}"
  49. round
  50. block
  51. type="danger"
  52. color="{{ color }}"
  53. custom-class="van-calendar__confirm"
  54. disabled="{{ computed.getButtonDisabled(type, currentDate) }}"
  55. nativeType="text"
  56. bind:click="onConfirm"
  57. >
  58. {{
  59. computed.getButtonDisabled(type, currentDate)
  60. ? confirmDisabledText
  61. : confirmText
  62. }}
  63. </van-button>
  64. </view>
  65. </view>