From 2bdfd4452175fbe59268eaed2bede1bcb741d165 Mon Sep 17 00:00:00 2001 From: qinwencheng <157475034@qq.com> Date: Fri, 2 Sep 2022 00:39:26 +0800 Subject: [PATCH] =?UTF-8?q?fix(time-select):=20=E4=BF=AE=E5=A4=8D=20#1290?= =?UTF-8?q?=20step=E5=B0=8F=E4=BA=8E=E7=AD=89=E4=BA=8E0=E6=97=B6=E4=BC=9A?= =?UTF-8?q?=E5=8D=A1=E6=AD=BB=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../devui-vue/devui/time-select/src/use-time-select.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/devui-vue/devui/time-select/src/use-time-select.ts b/packages/devui-vue/devui/time-select/src/use-time-select.ts index 26dbd8be61..680a94df1a 100644 --- a/packages/devui-vue/devui/time-select/src/use-time-select.ts +++ b/packages/devui-vue/devui/time-select/src/use-time-select.ts @@ -50,7 +50,10 @@ export function useTimeSelect(props: TimeSelectProps, ctx: SetupContext): useTim const step = computed(() => { const stepTime = parseTimeToNumber(props.step); - return stepTime ? formatTime(stepTime) : '00:30'; + if (stepTime && stepTime.hour >= 0 && stepTime.minute >= 0 && stepTime.hour + stepTime.minute > 0) { + return formatTime(stepTime); + } + return '00:30'; }); const minTime = computed(() => { @@ -84,7 +87,7 @@ export function useTimeSelect(props: TimeSelectProps, ctx: SetupContext): useTim list.push({ value: currentTime, name: currentTime, - disabled: compareTime(current, minTime.value || '-1:-1') <= 0 || compareTime(current, maxTime.value || '24:00') > 0, + disabled: compareTime(current, minTime.value || '-1:-1') < 0 || compareTime(current, maxTime.value || '24:00') > 0, }); current = nextTime(current, step.value); }