index.wxml 2.2 KB

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