From a5ed1f5b93f5bf77abdea952bce90c1ca68bb1e3 Mon Sep 17 00:00:00 2001 From: lushaojie Date: Tue, 10 Aug 2021 18:34:16 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9defaultTabBar=E4=B8=ADren?= =?UTF-8?q?derTab=E6=97=A0=E6=B3=95=E6=8B=BF=E5=88=B0index=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/DefaultTabBar.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DefaultTabBar.tsx b/src/DefaultTabBar.tsx index 540b68e..49ed5cb 100644 --- a/src/DefaultTabBar.tsx +++ b/src/DefaultTabBar.tsx @@ -159,7 +159,7 @@ export class DefaultTabBar extends React.PureComponent { className={cls} onClick={() => this.onPress(i)} > - {renderTab ? renderTab(t) : t.title} + {renderTab ? renderTab(t, i) : t.title} ; } From d32aa14fcb19870bb2efad9774580906951cfe88 Mon Sep 17 00:00:00 2001 From: lushaojie Date: Tue, 10 Aug 2021 18:55:52 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0defaultTabBar=E4=B8=ADren?= =?UTF-8?q?derTab=E6=97=A0=E6=B3=95=E6=8B=BF=E5=88=B0index=E7=9A=84?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/PropsType.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PropsType.ts b/src/PropsType.ts index 543cfd6..6bb5fcf 100644 --- a/src/PropsType.ts +++ b/src/PropsType.ts @@ -10,7 +10,7 @@ export interface TabBarPropsType { /** use animate | default: true */ animated: boolean; /** render the tab of tabbar */ - renderTab?: (tab: Models.TabData) => React.ReactNode; + renderTab?: (tab: Models.TabData, index: number) => React.ReactNode; /** render the underline of tabbar */ renderUnderline?: (style: React.CSSProperties | any) => React.ReactNode; /** page size of tabbar's tab | default: 5 */