calendar.wxml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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>