diff --git a/src/date-time-picker/date-time-picker.vue b/src/date-time-picker/date-time-picker.vue index f6aed1035..7c74434a3 100644 --- a/src/date-time-picker/date-time-picker.vue +++ b/src/date-time-picker/date-time-picker.vue @@ -173,7 +173,7 @@ export default defineComponent({ }); const onConfirm = () => { - props.onConfirm(dayjs(curDate.value).format(props.format)); + props.onConfirm?.(dayjs(curDate.value).format(props.format)); setDateTimePickerValue(dayjs(curDate.value).format(props.format)); };