2019-03-02 15:51:08 +08:00
|
|
|
---
|
|
|
|
order: 3
|
|
|
|
title:
|
2019-08-25 15:38:51 +08:00
|
|
|
zh-CN: 组合示例
|
|
|
|
en-US: Complete example
|
2019-03-02 15:51:08 +08:00
|
|
|
---
|
|
|
|
|
|
|
|
## zh-CN
|
|
|
|
|
2019-08-25 15:38:51 +08:00
|
|
|
使用了 pageHeader 提供的所有能力。
|
2019-03-02 15:51:08 +08:00
|
|
|
|
|
|
|
## en-US
|
|
|
|
|
2019-08-25 15:38:51 +08:00
|
|
|
Show all props.Used all the capabilities provided by pageHeader.
|
2019-03-02 15:51:08 +08:00
|
|
|
|
|
|
|
```jsx
|
2019-08-25 15:38:51 +08:00
|
|
|
import { PageHeader, Menu, Dropdown, Icon, Button, Tag, Typography, Row } from 'antd';
|
2019-03-02 15:51:08 +08:00
|
|
|
|
|
|
|
const { Paragraph } = Typography;
|
|
|
|
|
2019-08-25 15:38:51 +08:00
|
|
|
const menu = (
|
|
|
|
<Menu>
|
|
|
|
<Menu.Item>
|
|
|
|
<a target="_blank" rel="noopener noreferrer" href="http://www.alipay.com/">
|
|
|
|
1st menu item
|
|
|
|
</a>
|
|
|
|
</Menu.Item>
|
|
|
|
<Menu.Item>
|
|
|
|
<a target="_blank" rel="noopener noreferrer" href="http://www.taobao.com/">
|
|
|
|
2nd menu item
|
|
|
|
</a>
|
|
|
|
</Menu.Item>
|
|
|
|
<Menu.Item>
|
|
|
|
<a target="_blank" rel="noopener noreferrer" href="http://www.tmall.com/">
|
|
|
|
3rd menu item
|
|
|
|
</a>
|
|
|
|
</Menu.Item>
|
|
|
|
</Menu>
|
|
|
|
);
|
|
|
|
|
|
|
|
const DropdownMenu = () => {
|
|
|
|
return (
|
|
|
|
<Dropdown key="more" overlay={menu}>
|
|
|
|
<Button
|
|
|
|
style={{
|
|
|
|
border: 'none',
|
|
|
|
padding: 0,
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
<Icon
|
|
|
|
type="ellipsis"
|
|
|
|
style={{
|
|
|
|
fontSize: 20,
|
|
|
|
verticalAlign: 'top',
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
</Button>
|
|
|
|
</Dropdown>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
2019-03-02 15:51:08 +08:00
|
|
|
const routes = [
|
|
|
|
{
|
|
|
|
path: 'index',
|
|
|
|
breadcrumbName: 'First-level Menu',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'first',
|
|
|
|
breadcrumbName: 'Second-level Menu',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'second',
|
|
|
|
breadcrumbName: 'Third-level Menu',
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
2019-08-25 15:38:51 +08:00
|
|
|
const IconLink = ({ src, text }) => (
|
|
|
|
<a
|
|
|
|
style={{
|
|
|
|
marginRight: 16,
|
|
|
|
display: 'flex',
|
|
|
|
alignItems: 'center',
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
<img
|
|
|
|
style={{
|
|
|
|
marginRight: 8,
|
|
|
|
}}
|
|
|
|
src={src}
|
|
|
|
alt="start"
|
|
|
|
/>
|
|
|
|
{text}
|
|
|
|
</a>
|
|
|
|
);
|
|
|
|
|
2019-03-02 15:51:08 +08:00
|
|
|
const content = (
|
|
|
|
<div className="content">
|
|
|
|
<Paragraph>
|
2019-05-07 14:57:32 +08:00
|
|
|
Ant Design interprets the color system into two levels: a system-level color system and a
|
|
|
|
product-level color system.
|
2019-03-02 15:51:08 +08:00
|
|
|
</Paragraph>
|
|
|
|
<Paragraph>
|
2019-05-07 14:57:32 +08:00
|
|
|
Ant Design's design team preferred to design with the HSB color model, which makes it
|
|
|
|
easier for designers to have a clear psychological expectation of color when adjusting colors,
|
|
|
|
as well as facilitate communication in teams.
|
2019-03-02 15:51:08 +08:00
|
|
|
</Paragraph>
|
2019-08-25 15:38:51 +08:00
|
|
|
<Row className="contentLink" type="flex">
|
|
|
|
<IconLink
|
|
|
|
src="https://gw.alipayobjects.com/zos/rmsportal/MjEImQtenlyueSmVEfUD.svg"
|
|
|
|
text="Quick Start"
|
|
|
|
/>
|
|
|
|
<IconLink
|
|
|
|
src="https://gw.alipayobjects.com/zos/rmsportal/NbuDUAuBlIApFuDvWiND.svg"
|
|
|
|
text=" Product Info"
|
|
|
|
/>
|
|
|
|
<IconLink
|
|
|
|
src="https://gw.alipayobjects.com/zos/rmsportal/ohOEPSYdDTNnyMbGuyLb.svg"
|
|
|
|
text="Product Doc"
|
|
|
|
/>
|
|
|
|
</Row>
|
2019-03-02 15:51:08 +08:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
|
2019-08-25 15:38:51 +08:00
|
|
|
const Content = ({ children, extraContent }) => {
|
|
|
|
return (
|
|
|
|
<Row className="content" type="flex">
|
|
|
|
<div className="main" style={{ flex: 1 }}>
|
|
|
|
{children}
|
|
|
|
</div>
|
|
|
|
<div
|
|
|
|
className="extra"
|
|
|
|
style={{
|
|
|
|
marginLeft: 80,
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
{extraContent}
|
|
|
|
</div>
|
|
|
|
</Row>
|
|
|
|
);
|
|
|
|
};
|
2019-03-02 15:51:08 +08:00
|
|
|
|
|
|
|
ReactDOM.render(
|
2019-08-25 15:38:51 +08:00
|
|
|
<PageHeader
|
|
|
|
title="Title"
|
|
|
|
subTitle="This is a subtitle"
|
|
|
|
tags={<Tag color="blue">Running</Tag>}
|
|
|
|
extra={[
|
|
|
|
<Button key="3">Operation</Button>,
|
|
|
|
<Button key="2">Operation</Button>,
|
|
|
|
<Button key="1" type="primary">
|
|
|
|
Primary
|
|
|
|
</Button>,
|
|
|
|
<DropdownMenu key="more" />,
|
|
|
|
]}
|
|
|
|
avatar={{ src: 'https://avatars1.githubusercontent.com/u/8186664?s=460&v=4' }}
|
|
|
|
breadcrumb={{ routes }}
|
|
|
|
>
|
|
|
|
<Content
|
|
|
|
extraContent={
|
|
|
|
<img
|
|
|
|
src="https://gw.alipayobjects.com/mdn/mpaas_user/afts/img/A*KsfVQbuLRlYAAAAAAAAAAABjAQAAAQ/original"
|
|
|
|
alt="content"
|
|
|
|
/>
|
|
|
|
}
|
|
|
|
>
|
|
|
|
{content}
|
|
|
|
</Content>
|
2019-03-02 15:51:08 +08:00
|
|
|
</PageHeader>,
|
|
|
|
mountNode,
|
|
|
|
);
|
|
|
|
```
|
|
|
|
|
|
|
|
<style>
|
2019-08-25 15:38:51 +08:00
|
|
|
.ant-page-header {
|
|
|
|
border: 1px solid rgb(235, 237, 240);
|
2019-03-02 15:51:08 +08:00
|
|
|
}
|
2019-08-25 15:38:51 +08:00
|
|
|
<style>
|