Skip to content
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

Merged
merged 5 commits into from
Aug 7, 2024

Conversation

Layouwen
Copy link
Contributor

@Layouwen Layouwen commented Aug 7, 2024

resolve #6701

Copy link
Contributor

github-actions bot commented Aug 7, 2024

PR preview has been successfully built and deployed to https://antd-mobile-preview-pr-6702.surge.sh

@Devoureyes
Copy link

Oh god, THANK YOU
I am waiting for it!!

@@ -1,5 +1,5 @@
import React, { useState } from 'react'
import { Badge, TabBar } from 'antd-mobile'
import { Badge, TabBar, Toast } from 'antd-mobile'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个 Toast 没用到……

@@ -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` | - |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

文档加个版本号,下个 minor

@@ -12,6 +12,7 @@ export type TabBarItemProps = {
icon?: ReactNode | ((active: boolean) => ReactNode)
title?: ReactNode | ((active: boolean) => ReactNode)
badge?: BadgeProps['content']
onClick?: (key: string) => void
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

item 里的点击不需要给 key,因为事件本身就是在对应的 item 上的。直接是 VoidFunction 即可

@zombieJ zombieJ merged commit 045c330 into ant-design:master Aug 7, 2024
5 checks passed
@Layouwen Layouwen deleted the feature/tabbar-onclick branch August 7, 2024 06:13
@Devoureyes
Copy link

Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add onClick in TabBar
3 participants