-
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(TabBar): add onClick props to the TabBar.Item #6702
Conversation
PR preview has been successfully built and deployed to https://antd-mobile-preview-pr-6702.surge.sh |
Oh god, THANK YOU |
@@ -1,5 +1,5 @@ | |||
import React, { useState } from 'react' | |||
import { Badge, TabBar } from 'antd-mobile' | |||
import { Badge, TabBar, Toast } from 'antd-mobile' |
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.
这个 Toast 没用到……
src/components/tab-bar/index.en.md
Outdated
@@ -33,6 +33,7 @@ Useful for switching between different pages. | |||
| icon | Icon | `ReactNode \| ((active: boolean) => ReactNode)` | - | | |||
| key | Corresponding to `activeKey` | `string` | - | | |||
| title | Title | `ReactNode \| ((active: boolean) => ReactNode)` | - | | |||
| onClick | Callback when click item | `(key: string) => void` | - | |
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.
文档加个版本号,下个 minor
src/components/tab-bar/tab-bar.tsx
Outdated
@@ -12,6 +12,7 @@ export type TabBarItemProps = { | |||
icon?: ReactNode | ((active: boolean) => ReactNode) | |||
title?: ReactNode | ((active: boolean) => ReactNode) | |||
badge?: BadgeProps['content'] | |||
onClick?: (key: string) => void |
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.
item 里的点击不需要给 key,因为事件本身就是在对应的 item 上的。直接是 VoidFunction 即可
Thank you very much! |
resolve #6701