-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(CalendarPickerView): title support boolean value to control whether to hide #6676
feat(CalendarPickerView): title support boolean value to control whether to hide #6676
Conversation
PR preview has been successfully built and deployed to https://antd-mobile-preview-pr-6676.surge.sh |
@@ -41,7 +41,7 @@ export type CalendarPickerViewRef = { | |||
} | |||
|
|||
export type CalendarPickerViewProps = { | |||
title?: React.ReactNode | |||
title?: React.ReactNode | boolean |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
true 算什么?这里改成 React.ReactNode | false
@@ -117,6 +117,8 @@ export const CalendarPickerView = forwardRef< | |||
dayjs(dateRange ? dateRange[0] : today).date(1) | |||
) | |||
|
|||
const isDisplayHeader = useMemo(() => props.title !== false, [props.title]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个 useMemo
可以不写, !== false
速度比 func call 快多了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
另外直接叫 showHeader
就行了
|
行,那这个没啥问题 |
CalendarPickerView 的 title 可以通过配置 false 来隐藏