37 lines
1.7 KiB
Vue
37 lines
1.7 KiB
Vue
<template>
|
|
<uni-shadow-root class="vant-dist-calendar-calendar"><view class="van-calendar">
|
|
<header :title="title" :showTitle="showTitle" :subtitle="subtitle" :showSubtitle="showSubtitle" :firstDayOfWeek="firstDayOfWeek" @click-subtitle="onClickSubtitle">
|
|
<slot name="title" slot="title"></slot>
|
|
</header>
|
|
|
|
<scroll-view class="van-calendar__body" scroll-y :scroll-into-view="scrollIntoView">
|
|
<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>
|
|
</scroll-view>
|
|
|
|
<view :class="utils.bem('calendar__footer', { safeAreaInsetBottom })">
|
|
<slot name="footer"></slot>
|
|
</view>
|
|
|
|
<view :class="utils.bem('calendar__footer', { safeAreaInsetBottom })">
|
|
<van-button v-if="showConfirm" round block type="danger" :color="color" custom-class="van-calendar__confirm" :disabled="computed.getButtonDisabled(type, currentDate, minRange)" nativeType="text" @click="onConfirm">
|
|
{{
|
|
computed.getButtonDisabled(type, currentDate, minRange)
|
|
? confirmDisabledText
|
|
: confirmText
|
|
}}
|
|
</van-button>
|
|
</view>
|
|
</view></uni-shadow-root>
|
|
</template>
|
|
|
|
<script>
|
|
|
|
global['__wxRoute'] = 'vant/dist/calendar/calendar'
|
|
|
|
Component({})
|
|
|
|
export default global['__wxComponents']['vant/dist/calendar/calendar']
|
|
</script>
|
|
<style platform="mp-weixin">
|
|
|
|
</style> |