calendar.wxml 1.8 KB

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