Skip to content

Commit 8d65bd6

Browse files
committed
refactor(YearMonthPicker): 添加 props声明
1 parent 5170aeb commit 8d65bd6

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

src/calendar/CalendarYearMonth.tsx

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import { ExtractPropTypes, type PropType } from 'vue';
2+
import type { CalendarDateType, DisabledScrollType, LangType } from './types';
3+
import {
4+
makeDateProp,
5+
makeNumberProp,
6+
makeStringProp,
7+
truthProp,
8+
} from './utils';
9+
10+
export const yearMonthPickerProps = {
11+
minDate: makeDateProp(null),
12+
maxDate: makeDateProp(null),
13+
disabledDate: {
14+
type: Function,
15+
default: () => false,
16+
},
17+
scrollChangeDate: truthProp,
18+
checkedDayClassName: makeStringProp<string>(''),
19+
notCurrentMonthDayClassName: makeStringProp<string>(''),
20+
disabledClassName: makeStringProp<string>(''),
21+
type: String,
22+
calendarTitleHeight: makeNumberProp(0),
23+
calendarContentHeight: makeNumberProp(0),
24+
disabledScroll: {
25+
type: [Boolean, String] as PropType<DisabledScrollType>,
26+
default: () => false,
27+
},
28+
calendarDate: {
29+
type: Object as PropType<CalendarDateType>,
30+
default: () => ({}),
31+
},
32+
lang: makeStringProp<LangType>('CN'),
33+
};
34+
35+
export type YearMonthPickerPropsType = ExtractPropTypes<
36+
typeof yearMonthPickerProps
37+
>;

src/calendar/index.less

+4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
background: none;
2222
height: 710px;
2323
z-index: 1;
24+
25+
.calendar_content {
26+
top: 0;
27+
}
2428
}
2529

2630
.calendar_content {

0 commit comments

Comments
 (0)