Skip to content

Commit

Permalink
fix: ts类型报错
Browse files Browse the repository at this point in the history
  • Loading branch information
liweijie0812 committed Dec 1, 2023
1 parent 1c9810e commit 3f14811
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/time-picker/panel/time-picker-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { panelProps } from './props';
import SinglePanel from './single-panel';
import TButton from '../../button/button';
import { useConfig, usePrefixClass } from '../../hooks/useConfig';
import { TimePickerValue } from '../type';
import { TimePickerValue, TimeRangeValue } from '../type';
import log from '../../_common/js/log';

dayjs.extend(customParseFormat);
Expand Down Expand Up @@ -52,7 +52,9 @@ export default defineComponent({
const resetTriggerScroll = () => {
triggerScroll.value = false;
};
const handlePresetClick = (presetValue: TimePickerValue | (() => TimePickerValue)) => {
const handlePresetClick = (
presetValue: TimePickerValue | (() => TimePickerValue) | TimeRangeValue | (() => TimeRangeValue),
) => {
const presetVal = typeof presetValue === 'function' ? presetValue() : presetValue;
if (typeof props.activeIndex === 'number') {
if (Array.isArray(presetVal)) {
Expand Down

0 comments on commit 3f14811

Please sign in to comment.