calendar.wxml 1.7 KB

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