From 4a93a61dfc61418b0bcbf08916a2c0b183b15bf5 Mon Sep 17 00:00:00 2001 From: Uyarn Date: Tue, 31 Dec 2024 16:42:44 +0800 Subject: [PATCH] fix(DatePicker): optimize date range picker panel initial render result --- src/date-picker/DateRangePickerPanel.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/date-picker/DateRangePickerPanel.tsx b/src/date-picker/DateRangePickerPanel.tsx index 39068579ca..f96067d6a9 100644 --- a/src/date-picker/DateRangePickerPanel.tsx +++ b/src/date-picker/DateRangePickerPanel.tsx @@ -66,7 +66,7 @@ export default defineComponent({ } month.value = nextMonth; // 月份季度选择时需要确保右侧面板年份比左侧大 - if ((props.mode === 'month' || props.mode === 'quarter') && year.value[0] === year.value[1]) { + if (['month', 'quarter'].includes(props.mode) && year.value[0] === year.value[1]) { year.value = [year.value[0], year.value[0] + 1]; } }