diff --git a/src/components/calendar-picker-view/calendar-picker-view.tsx b/src/components/calendar-picker-view/calendar-picker-view.tsx index 83a38591e1..f682e0d13a 100644 --- a/src/components/calendar-picker-view/calendar-picker-view.tsx +++ b/src/components/calendar-picker-view/calendar-picker-view.tsx @@ -41,7 +41,7 @@ export type CalendarPickerViewRef = { } export type CalendarPickerViewProps = { - title?: React.ReactNode + title?: React.ReactNode | boolean confirmText?: string weekStartsOn?: 'Monday' | 'Sunday' renderTop?: (date: Date) => React.ReactNode @@ -117,6 +117,8 @@ export const CalendarPickerView = forwardRef< dayjs(dateRange ? dateRange[0] : today).date(1) ) + const isDisplayHeader = useMemo(() => props.title !== false, [props.title]) + // =============================== Scroll =============================== const context = useContext(Context) const scrollTo = useSyncScroll(current, context.visible, bodyRef) @@ -356,7 +358,7 @@ export const CalendarPickerView = forwardRef< return withNativeProps( props,
- {header} + {isDisplayHeader && header} {mark} {body}