index.wxml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <wxs src="./index.wxs" module="computed"></wxs>
  2. <wxs src="../../../wxs/utils.wxs" module="utils" />
  3. <view class="van-calendar__month" style="{{ computed.getMonthStyle(visible, date, rowHeight) }}">
  4. <view wx:if="{{ showMonthTitle }}" class="van-calendar__month-title">
  5. {{ computed.formatMonthTitle(date) }}
  6. </view>
  7. <view wx:if="{{ visible }}" class="van-calendar__days">
  8. <view wx:if="{{ showMark }}" class="van-calendar__month-mark">
  9. {{ computed.getMark(date) }}
  10. </view>
  11. <view
  12. wx:for="{{ days }}"
  13. wx:key="index"
  14. style="{{ computed.getDayStyle(item.type, index, date, rowHeight, color, firstDayOfWeek) }}"
  15. class="{{ utils.bem('calendar__day', [item.type]) }} {{ item.className }}"
  16. data-index="{{ index }}"
  17. bindtap="onClick"
  18. >
  19. <view wx:if="{{ item.type === 'selected' }}" class="van-calendar__selected-day" style="width: {{ rowHeight }}px; height: {{ rowHeight }}px; background: {{ color }}">
  20. <view wx:if="{{ item.topInfo }}" class="van-calendar__top-info">{{ item.topInfo }}</view>
  21. {{ item.text }}
  22. <view wx:if="{{ item.bottomInfo }}" class="van-calendar__bottom-info">
  23. {{ item.bottomInfo }}
  24. </view>
  25. </view>
  26. <view wx:else>
  27. <view wx:if="{{ item.topInfo }}" class="van-calendar__top-info">{{ item.topInfo }}</view>
  28. {{ item.text }}
  29. <view wx:if="{{ item.bottomInfo }}" class="van-calendar__bottom-info">
  30. {{ item.bottomInfo }}
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. </view>