fix: component ts build error
parent
5b20498792
commit
3fc7a050ec
|
@ -58,15 +58,18 @@ export type TimePickerProps<DateType> = CommonProps<DateType> &
|
||||||
addon?: () => void;
|
addon?: () => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
function createTimePicker<DateType>(generateConfig: GenerateConfig<DateType>) {
|
function createTimePicker<
|
||||||
|
DateType,
|
||||||
|
DTimePickerProps extends TimePickerProps<DateType> = TimePickerProps<DateType>,
|
||||||
|
DTimeRangePickerProps extends TimeRangePickerProps<DateType> = TimeRangePickerProps<DateType>,
|
||||||
|
>(generateConfig: GenerateConfig<DateType>) {
|
||||||
const DatePicker = generatePicker<DateType>(generateConfig, {
|
const DatePicker = generatePicker<DateType>(generateConfig, {
|
||||||
...timePickerProps,
|
...timePickerProps,
|
||||||
order: { type: Boolean, default: true },
|
order: { type: Boolean, default: true },
|
||||||
});
|
});
|
||||||
|
|
||||||
const { TimePicker: InternalTimePicker, RangePicker: InternalRangePicker } = DatePicker as any;
|
const { TimePicker: InternalTimePicker, RangePicker: InternalRangePicker } = DatePicker as any;
|
||||||
|
const TimePicker = defineComponent<DTimePickerProps>({
|
||||||
const TimePicker = defineComponent({
|
|
||||||
name: 'ATimePicker',
|
name: 'ATimePicker',
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
props: {
|
props: {
|
||||||
|
@ -74,7 +77,7 @@ function createTimePicker<DateType>(generateConfig: GenerateConfig<DateType>) {
|
||||||
...datePickerProps<DateType>(),
|
...datePickerProps<DateType>(),
|
||||||
...timePickerProps,
|
...timePickerProps,
|
||||||
addon: { type: Function },
|
addon: { type: Function },
|
||||||
},
|
} as any,
|
||||||
slot: ['addon', 'renderExtraFooter', 'suffixIcon', 'clearIcon'],
|
slot: ['addon', 'renderExtraFooter', 'suffixIcon', 'clearIcon'],
|
||||||
setup(props, { slots, expose, emit, attrs }) {
|
setup(props, { slots, expose, emit, attrs }) {
|
||||||
const formItemContext = useInjectFormItemContext();
|
const formItemContext = useInjectFormItemContext();
|
||||||
|
@ -136,7 +139,7 @@ function createTimePicker<DateType>(generateConfig: GenerateConfig<DateType>) {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const TimeRangePicker = defineComponent({
|
const TimeRangePicker = defineComponent<DTimeRangePickerProps>({
|
||||||
name: 'ATimeRangePicker',
|
name: 'ATimeRangePicker',
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
props: {
|
props: {
|
||||||
|
@ -144,7 +147,7 @@ function createTimePicker<DateType>(generateConfig: GenerateConfig<DateType>) {
|
||||||
...rangePickerProps<DateType>(),
|
...rangePickerProps<DateType>(),
|
||||||
...timePickerProps,
|
...timePickerProps,
|
||||||
order: { type: Boolean, default: true },
|
order: { type: Boolean, default: true },
|
||||||
},
|
} as any,
|
||||||
slot: ['renderExtraFooter', 'suffixIcon', 'clearIcon'],
|
slot: ['renderExtraFooter', 'suffixIcon', 'clearIcon'],
|
||||||
setup(props, { slots, expose, emit, attrs }) {
|
setup(props, { slots, expose, emit, attrs }) {
|
||||||
const pickerRef = ref();
|
const pickerRef = ref();
|
||||||
|
|
Loading…
Reference in New Issue