From efa045ab9cc22f5ae4c8d0c0545b6fdf3926d51c Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Thu, 6 Jan 2022 10:27:05 +0800 Subject: [PATCH] doc: fix select range time issue, close #5125 --- components/date-picker/demo/select-in-range.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/date-picker/demo/select-in-range.vue b/components/date-picker/demo/select-in-range.vue index e7412e565..be5203974 100644 --- a/components/date-picker/demo/select-in-range.vue +++ b/components/date-picker/demo/select-in-range.vue @@ -35,7 +35,7 @@ export default defineComponent({ const hackValue = ref(); const disabledDate = (current: Dayjs) => { - if (!dates.value) { + if (!dates.value || (dates.value as any).length === 0) { return false; } const tooLate = dates.value[0] && current.diff(dates.value[0], 'days') > 7; @@ -45,8 +45,8 @@ export default defineComponent({ const onOpenChange = (open: boolean) => { if (open) { - dates.value = null; - hackValue.value = null; + dates.value = [] as any; + hackValue.value = [] as any; } else { hackValue.value = undefined; }