Skip to content
This repository was archived by the owner on Aug 12, 2025. It is now read-only.

Commit df759b5

Browse files
committed
feat: add the title extra for xconsole page
1 parent 65c568a commit df759b5

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

packages/ui/xconsole-rc-page-header/src/index.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ export const PageHeader: React.FC<IProps> = (props: IProps) => {
1717
breadcrumbs,
1818
extra,
1919
historyBack,
20+
titleExtra,
21+
titleExtraAlign,
2022
nav,
2123
children,
2224
onBackArrowClick,
@@ -28,6 +30,8 @@ export const PageHeader: React.FC<IProps> = (props: IProps) => {
2830
<XConsoleRcPage
2931
breadcrumbs={breadcrumbs}
3032
breadcrumbExtra={extra}
33+
titleExtra={titleExtra}
34+
titleExtraAlign={titleExtraAlign}
3135
pageProps={restProps}
3236
title={title}
3337
subTitle={

packages/ui/xconsole-rc-page-header/src/types.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import React from 'react';
1+
import React, { ReactNode } from 'react';
22
import { SelectProps } from '@alifd/next/lib/select';
33
import { History } from 'history';
44

55
export interface INavProps {
6-
shape: 'tab' | 'menu';
6+
shape: 'tab' | 'menu' | string;
77
defaultActiveKey?: string;
88
activeKey?: string;
99
onChange?: (value: string) => void;
@@ -19,15 +19,17 @@ interface IBreadcrumbItem extends React.AnchorHTMLAttributes<HTMLAnchorElement>
1919

2020

2121
export interface IProps {
22-
title: string;
22+
title: ReactNode;
23+
titleExtra?: ReactNode;
24+
titleExtraAlign?: 'left' | 'right';
2325
subTitle?: string;
2426
subSwitcher?: SelectProps;
2527
breadcrumbs?: IBreadcrumbItem[];
2628
historyBack?: string;
2729
history?: History;
28-
extra?: React.ReactNode;
30+
extra?: ReactNode;
2931
nav?: INavProps;
30-
children?: React.ReactNode;
32+
children?: ReactNode;
3133
onBackArrowClick?: () => void;
3234
hasBackArrow?: boolean;
3335
}

packages/ui/xconsole-rc-page-header/stories/index.stories.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ const App = () => (
7474
historyBack="/users"
7575
breadcrumbs={breadcrumbs}
7676
nav={nav}
77+
titleExtra={<div>xxxxx</div>}
7778
/>
7879
);
7980

packages/xconsole/xconsole.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"version":"2.3.48"}
1+
{"version":"2.3.49"}

0 commit comments

Comments
 (0)