完整用法
月历面板,单日/多日/区间三档选择,可显示农历与自定义标记
<cu-calendar :show="showSingle" @confirm="onSingleConfirm" @close="onSingleClose" /> <cu-calendar :show="showMulti" mode="multiple" :maxCount="3" :defaultDate="multiDefault" title="多选(上限 3 天)" @confirm="onMultiConfirm" @close="onMultiClose" /> <cu-calendar :show="showRange" mode="range" :defaultDate="rangeDefault" title="区间选择(先起点后终点)" @confirm="onRangeConfirm" @close="onRangeClose" /> <cu-calendar :show="showRangeSame" mode="range" :allowSameDay="true" title="区间 + allowSameDay" @confirm="onRangeConfirm" @close="onRangeClose" /> <cu-calendar :show="showMaxRange" mode="range" :maxRange="7" title="maxRange = 7 天" @confirm="onMaxRangeConfirm" @close="onMaxRangeClose" /> <cu-calendar :show="showLunarPanel" :showLunar="true" :showMark="true" mode="range" title="农历 + 月份水印" @confirm="onLunarConfirm" @close="onLunarClose" /> <cu-calendar :show="showReadonly" :readonly="true" :showTitle="false" :showConfirm="false" :showMark="false" :defaultDate="roDefault" @confirm="onReadonlyConfirm" @close="onReadonlyClose" /> <cu-calendar :show="showCustom" :customList="customList" :showMark="true" :showLunar="true" :monthNum="2" :formatter="emptyFormatter" title="customList 标注" @confirm="onCustomConfirm" @close="onCustomClose" /> <cu-calendar :show="showBad" :minDate="badMin" :maxDate="badMax" title="minDate 晚于 maxDate" @confirm="onBadConfirm" @close="onBadClose" /> <cu-calendar :show="showColor" :color="myColor" :round="true" mode="range" :monthNum="4" title="自定义主色 + 圆角" @confirm="onColorConfirm" @close="onColorClose" /> <cu-calendar :show="showLabels" mode="range" :startText="'入住'" :endText="'离店'" :rowHeight="96" :confirmText="'选好了'" :confirmDisabledText="'请再选一天'" title="自定义文案与行高" @confirm="onLabelsConfirm" @close="onLabelsClose" /> <cu-calendar :show="showPromptText" mode="range" :maxRange="3" :rangePrompt="'最多可选 3 天(自定义文案)'" title="自定义 rangePrompt" @confirm="onLabelsConfirm" @close="onLabelsClose" /> <cu-calendar :show="showSilentRange" mode="range" :maxRange="3" :showRangePrompt="false" title="showRangePrompt = false" @confirm="onLabelsConfirm" @close="onLabelsClose" />