fix: timeRangePicker ts type support string
parent
d645ad6eda
commit
6f8c75cd6d
|
@ -46,10 +46,25 @@ export interface CommonTimePickerProps {
|
||||||
hideDisabledOptions?: boolean;
|
hideDisabledOptions?: boolean;
|
||||||
popupClassName?: string;
|
popupClassName?: string;
|
||||||
}
|
}
|
||||||
|
export type TimeRangePickerProps<DateType> = Omit<
|
||||||
export type TimeRangePickerProps<T> = Omit<RangePickerTimeProps<T>, 'picker'> & {
|
RangePickerTimeProps<DateType>,
|
||||||
|
'picker' | 'defaultPickerValue' | 'defaultValue' | 'value' | 'onChange' | 'onPanelChange' | 'onOk'
|
||||||
|
> & {
|
||||||
popupClassName?: string;
|
popupClassName?: string;
|
||||||
valueFormat?: string;
|
valueFormat?: string;
|
||||||
|
defaultPickerValue?: RangeValue<DateType> | RangeValue<string>;
|
||||||
|
defaultValue?: RangeValue<DateType> | RangeValue<string>;
|
||||||
|
value?: RangeValue<DateType> | RangeValue<string>;
|
||||||
|
onChange?: (
|
||||||
|
value: RangeValue<DateType> | RangeValue<string> | null,
|
||||||
|
dateString: [string, string],
|
||||||
|
) => void;
|
||||||
|
'onUpdate:value'?: (value: RangeValue<DateType> | RangeValue<string> | null) => void;
|
||||||
|
onPanelChange?: (
|
||||||
|
values: RangeValue<DateType> | RangeValue<string>,
|
||||||
|
modes: [PanelMode, PanelMode],
|
||||||
|
) => void;
|
||||||
|
onOk?: (dates: RangeValue<DateType> | RangeValue<string>) => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type TimePickerProps<DateType> = CommonProps<DateType> &
|
export type TimePickerProps<DateType> = CommonProps<DateType> &
|
||||||
|
@ -151,9 +166,7 @@ function createTimePicker<
|
||||||
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();
|
||||||
|
|
||||||
const formItemContext = useInjectFormItemContext();
|
const formItemContext = useInjectFormItemContext();
|
||||||
|
|
||||||
expose({
|
expose({
|
||||||
focus: () => {
|
focus: () => {
|
||||||
pickerRef.value?.focus();
|
pickerRef.value?.focus();
|
||||||
|
|
Loading…
Reference in New Issue