diff --git a/pages/demo/form/calendar.uvue b/pages/demo/form/calendar.uvue index 79f043f..3ddee9d 100644 --- a/pages/demo/form/calendar.uvue +++ b/pages/demo/form/calendar.uvue @@ -5,37 +5,188 @@ - - + + + + + + - + + + - + + + + + + + + + + + + + + + + diff --git a/uni_modules/cool-ui/components/cl-calendar-select/cl-calendar-select.uvue b/uni_modules/cool-ui/components/cl-calendar-select/cl-calendar-select.uvue index 66abfc8..1056965 100644 --- a/uni_modules/cool-ui/components/cl-calendar-select/cl-calendar-select.uvue +++ b/uni_modules/cool-ui/components/cl-calendar-select/cl-calendar-select.uvue @@ -33,7 +33,8 @@ v-model="value" v-model:date="date" :mode="mode" - :disabled-date="disabledDate" + :date-config="dateConfig" + @change="onCalendarChange" > @@ -68,7 +69,7 @@ @@ -694,7 +775,6 @@ onMounted(() => { &__view { @apply w-full; - /* Web端DOM渲染样式 */ // #ifndef APP /* 日期行样式 */ &-row { @@ -706,16 +786,6 @@ onMounted(() => { @apply flex-1 flex flex-col items-center justify-center relative; height: 80rpx; - /* 选中状态样式 */ - &.is-selected { - background-color: v-bind("props.selectedBgColor"); - } - - /* 范围选择背景样式 */ - &.is-range { - background-color: v-bind("props.rangeBgColor"); - } - /* 隐藏状态(相邻月份日期) */ &.is-hide { opacity: 0; diff --git a/uni_modules/cool-ui/components/cl-calendar/picker.uvue b/uni_modules/cool-ui/components/cl-calendar/picker.uvue index 109b6cf..64606b6 100644 --- a/uni_modules/cool-ui/components/cl-calendar/picker.uvue +++ b/uni_modules/cool-ui/components/cl-calendar/picker.uvue @@ -140,7 +140,7 @@ const list = computed(() => { // - 年份模式下显示“起始年 - 结束年” const title = computed(() => { return mode.value == "month" - ? `${year.value}年` + ? `${year.value}` : `${first(list.value)?.label} - ${last(list.value)?.label}`; }); diff --git a/uni_modules/cool-ui/types/index.ts b/uni_modules/cool-ui/types/index.ts index 59f84e1..5446d12 100644 --- a/uni_modules/cool-ui/types/index.ts +++ b/uni_modules/cool-ui/types/index.ts @@ -200,3 +200,11 @@ export type ClTreeNodeInfo = { }; export type ClCalendarMode = "single" | "multiple" | "range"; + +export type ClCalendarDateConfig = { + date: string; + topText?: string; + bottomText?: string; + disabled?: boolean; + color?: string; +};