calendar.wxml 1.6 KB

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