calendar.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <template>
  2. <uni-shadow-root class="vant-calendar-calendar"><view class="van-calendar">
  3. <header :title="title" :showTitle="showTitle" :subtitle="subtitle" :showSubtitle="showSubtitle" :firstDayOfWeek="firstDayOfWeek" @click-subtitle="onClickSubtitle">
  4. <slot name="title" slot="title"></slot>
  5. </header>
  6. <scroll-view class="van-calendar__body" scroll-y :scroll-into-view="scrollIntoView">
  7. <month v-for="(item,index) in (computed.getMonths(minDate, maxDate))" :key="item.index" :id="'month'+(index)" class="month" :data-date="item" :date="item" :type="type" :color="color" :minDate="minDate" :maxDate="maxDate" :showMark="showMark" :formatter="formatter" :rowHeight="rowHeight" :currentDate="currentDate" :showSubtitle="showSubtitle" :allowSameDay="allowSameDay" :showMonthTitle="index !== 0 || !showSubtitle" :firstDayOfWeek="firstDayOfWeek" @click="onClickDay"></month>
  8. </scroll-view>
  9. <view :class="utils.bem('calendar__footer', { safeAreaInsetBottom })">
  10. <slot name="footer"></slot>
  11. </view>
  12. <view :class="utils.bem('calendar__footer', { safeAreaInsetBottom })">
  13. <van-button v-if="showConfirm" round block type="danger" :color="color" custom-class="van-calendar__confirm" :disabled="computed.getButtonDisabled(type, currentDate)" nativeType="text" @click="onConfirm">
  14. {{
  15. computed.getButtonDisabled(type, currentDate)
  16. ? confirmDisabledText
  17. : confirmText
  18. }}
  19. </van-button>
  20. </view>
  21. </view></uni-shadow-root>
  22. </template>
  23. <script>
  24. global['__wxRoute'] = 'vant/calendar/calendar'
  25. Component({})
  26. export default global['__wxComponents']['vant/calendar/calendar']
  27. </script>
  28. <style platform="mp-weixin">
  29. </style>