From c834a2f89e7eb1789518e5b586d1654971fd39e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Sun, 3 Dec 2023 20:43:50 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/time-picker/panel/time-picker-panel.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/time-picker/panel/time-picker-panel.tsx b/src/time-picker/panel/time-picker-panel.tsx index b31fd87067..d7d2fefa7b 100644 --- a/src/time-picker/panel/time-picker-panel.tsx +++ b/src/time-picker/panel/time-picker-panel.tsx @@ -28,7 +28,7 @@ export default defineComponent({ const triggerScroll = ref(false); const panelRef = ref(); const { globalConfig } = useConfig('timePicker'); - const showNowTimeBtn = computed(() => !!steps.value.filter((v) => Number(v) > 1).length); + const showNowTimeBtn = computed(() => !!steps.value.filter((step) => Number(step) > 1).length); const defaultValue = computed(() => { const isStepsSet = showNowTimeBtn.value; @@ -58,12 +58,12 @@ export default defineComponent({ const presetVal = typeof presetValue === 'function' ? presetValue() : presetValue; if (typeof props.activeIndex === 'number') { if (Array.isArray(presetVal)) { - props.onChange(presetVal[props.activeIndex]); + props.onChange?.(presetVal[props.activeIndex]); } else { log.error('TimePicker', `preset: ${props.presets} 预设值必须是数组!`); } } else { - props.onChange(presetVal); + props.onChange?.(presetVal); } };