calendar.wxml 1.8 KB

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