2019-08-25 15:38:51 +08:00
|
|
|
---
|
2019-10-15 11:46:12 +08:00
|
|
|
order: 6
|
2020-04-10 19:25:31 +08:00
|
|
|
iframe: 228
|
2019-08-25 15:38:51 +08:00
|
|
|
title:
|
|
|
|
zh-CN: 响应式
|
|
|
|
en-US: responsive
|
|
|
|
---
|
|
|
|
|
|
|
|
## zh-CN
|
|
|
|
|
2021-12-01 13:25:35 +08:00
|
|
|
在不同大小的屏幕下,应该有不同的表现。
|
2019-08-25 15:38:51 +08:00
|
|
|
|
|
|
|
## en-US
|
|
|
|
|
|
|
|
Under different screen sizes, there should be different performance
|
|
|
|
|
2022-05-19 09:46:26 +08:00
|
|
|
```tsx
|
|
|
|
import React from 'react';
|
2019-08-25 15:38:51 +08:00
|
|
|
import { PageHeader, Tabs, Button, Statistic, Descriptions } from 'antd';
|
|
|
|
|
|
|
|
const { TabPane } = Tabs;
|
|
|
|
|
|
|
|
const renderContent = (column = 2) => (
|
|
|
|
<Descriptions size="small" column={column}>
|
2019-09-04 17:02:19 +08:00
|
|
|
<Descriptions.Item label="Created">Lili Qu</Descriptions.Item>
|
|
|
|
<Descriptions.Item label="Association">
|
2019-08-25 15:38:51 +08:00
|
|
|
<a>421421</a>
|
2019-09-04 17:02:19 +08:00
|
|
|
</Descriptions.Item>
|
|
|
|
<Descriptions.Item label="Creation Time">2017-01-10</Descriptions.Item>
|
|
|
|
<Descriptions.Item label="Effective Time">2017-10-10</Descriptions.Item>
|
|
|
|
<Descriptions.Item label="Remarks">
|
2019-08-25 15:38:51 +08:00
|
|
|
Gonghu Road, Xihu District, Hangzhou, Zhejiang, China
|
2019-09-04 17:02:19 +08:00
|
|
|
</Descriptions.Item>
|
2019-08-25 15:38:51 +08:00
|
|
|
</Descriptions>
|
|
|
|
);
|
|
|
|
|
|
|
|
const extraContent = (
|
|
|
|
<div
|
|
|
|
style={{
|
|
|
|
display: 'flex',
|
|
|
|
width: 'max-content',
|
|
|
|
justifyContent: 'flex-end',
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
<Statistic
|
|
|
|
title="Status"
|
|
|
|
value="Pending"
|
|
|
|
style={{
|
|
|
|
marginRight: 32,
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
<Statistic title="Price" prefix="$" value={568.08} />
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
|
2022-05-19 09:46:26 +08:00
|
|
|
const Content: React.FC<{ children: React.ReactNode; extra: React.ReactNode }> = ({
|
|
|
|
children,
|
|
|
|
extra,
|
|
|
|
}) => (
|
2020-12-09 17:12:32 +08:00
|
|
|
<div className="content">
|
|
|
|
<div className="main">{children}</div>
|
|
|
|
<div className="extra">{extra}</div>
|
|
|
|
</div>
|
|
|
|
);
|
2019-08-25 15:38:51 +08:00
|
|
|
|
2022-05-19 09:46:26 +08:00
|
|
|
const App: React.FC = () => (
|
2021-11-26 12:18:21 +08:00
|
|
|
<PageHeader
|
|
|
|
className="site-page-header-responsive"
|
|
|
|
onBack={() => window.history.back()}
|
|
|
|
title="Title"
|
|
|
|
subTitle="This is a subtitle"
|
|
|
|
extra={[
|
|
|
|
<Button key="3">Operation</Button>,
|
|
|
|
<Button key="2">Operation</Button>,
|
|
|
|
<Button key="1" type="primary">
|
|
|
|
Primary
|
|
|
|
</Button>,
|
|
|
|
]}
|
|
|
|
footer={
|
|
|
|
<Tabs defaultActiveKey="1">
|
|
|
|
<TabPane tab="Details" key="1" />
|
|
|
|
<TabPane tab="Rule" key="2" />
|
|
|
|
</Tabs>
|
|
|
|
}
|
|
|
|
>
|
|
|
|
<Content extra={extraContent}>{renderContent()}</Content>
|
2022-04-03 23:27:45 +08:00
|
|
|
</PageHeader>
|
2019-08-25 15:38:51 +08:00
|
|
|
);
|
2022-05-19 09:46:26 +08:00
|
|
|
|
|
|
|
export default App;
|
2019-08-25 15:38:51 +08:00
|
|
|
```
|
|
|
|
|
|
|
|
<style>
|
|
|
|
tr:last-child td {
|
|
|
|
padding-bottom: 0;
|
|
|
|
}
|
2019-10-15 11:46:12 +08:00
|
|
|
.ant-statistic-content {
|
|
|
|
font-size: 20px;
|
|
|
|
line-height: 28px;
|
|
|
|
}
|
2019-08-25 15:38:51 +08:00
|
|
|
#components-page-header-demo-responsive .content {
|
|
|
|
display: flex;
|
|
|
|
}
|
|
|
|
@media (max-width: 576px) {
|
|
|
|
#components-page-header-demo-responsive .content {
|
|
|
|
display: block;
|
|
|
|
}
|
|
|
|
|
|
|
|
#components-page-header-demo-responsive .main {
|
|
|
|
width: 100%;
|
|
|
|
margin-bottom: 12px;
|
|
|
|
}
|
|
|
|
|
|
|
|
#components-page-header-demo-responsive .extra {
|
|
|
|
width: 100%;
|
|
|
|
margin-left: 0;
|
|
|
|
text-align: left;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|