2016-12-30 21:41:28 +08:00
|
|
|
---
|
|
|
|
order: 0
|
|
|
|
title:
|
|
|
|
zh-CN: 基本结构
|
|
|
|
en-US: Basic Structure
|
|
|
|
---
|
|
|
|
|
|
|
|
## zh-CN
|
|
|
|
|
|
|
|
典型的页面布局。
|
|
|
|
|
|
|
|
## en-US
|
|
|
|
|
|
|
|
Classic page layouts.
|
|
|
|
|
2019-05-07 14:57:32 +08:00
|
|
|
```jsx
|
2016-12-30 21:41:28 +08:00
|
|
|
import { Layout } from 'antd';
|
2018-06-27 15:55:04 +08:00
|
|
|
|
2019-05-07 14:57:32 +08:00
|
|
|
const { Header, Footer, Sider, Content } = Layout;
|
2016-12-30 21:41:28 +08:00
|
|
|
|
2022-04-03 23:27:45 +08:00
|
|
|
export default () => (
|
2020-07-15 18:31:58 +08:00
|
|
|
<>
|
2016-12-30 21:41:28 +08:00
|
|
|
<Layout>
|
2017-02-23 11:45:48 +08:00
|
|
|
<Header>Header</Header>
|
2016-12-30 21:41:28 +08:00
|
|
|
<Content>Content</Content>
|
2017-02-23 11:45:48 +08:00
|
|
|
<Footer>Footer</Footer>
|
2016-12-30 21:41:28 +08:00
|
|
|
</Layout>
|
|
|
|
|
|
|
|
<Layout>
|
2017-02-23 11:45:48 +08:00
|
|
|
<Header>Header</Header>
|
|
|
|
<Layout>
|
|
|
|
<Sider>Sider</Sider>
|
|
|
|
<Content>Content</Content>
|
|
|
|
</Layout>
|
|
|
|
<Footer>Footer</Footer>
|
2016-12-30 21:41:28 +08:00
|
|
|
</Layout>
|
|
|
|
|
2017-02-23 11:45:48 +08:00
|
|
|
<Layout>
|
2016-12-30 21:41:28 +08:00
|
|
|
<Header>Header</Header>
|
2017-02-23 11:45:48 +08:00
|
|
|
<Layout>
|
|
|
|
<Content>Content</Content>
|
|
|
|
<Sider>Sider</Sider>
|
|
|
|
</Layout>
|
2016-12-30 21:41:28 +08:00
|
|
|
<Footer>Footer</Footer>
|
2017-02-23 11:45:48 +08:00
|
|
|
</Layout>
|
|
|
|
|
|
|
|
<Layout>
|
|
|
|
<Sider>Sider</Sider>
|
2017-02-24 16:34:10 +08:00
|
|
|
<Layout>
|
2017-02-23 11:45:48 +08:00
|
|
|
<Header>Header</Header>
|
|
|
|
<Content>Content</Content>
|
|
|
|
<Footer>Footer</Footer>
|
2017-02-24 16:34:10 +08:00
|
|
|
</Layout>
|
2017-02-23 11:45:48 +08:00
|
|
|
</Layout>
|
2022-04-03 23:27:45 +08:00
|
|
|
</>
|
2018-11-28 15:00:03 +08:00
|
|
|
);
|
2019-05-07 14:57:32 +08:00
|
|
|
```
|
2016-12-30 21:41:28 +08:00
|
|
|
|
|
|
|
<style>
|
|
|
|
#components-layout-demo-basic .code-box-demo {
|
|
|
|
text-align: center;
|
|
|
|
}
|
|
|
|
#components-layout-demo-basic .ant-layout-header,
|
|
|
|
#components-layout-demo-basic .ant-layout-footer {
|
|
|
|
color: #fff;
|
2020-10-26 12:17:07 +08:00
|
|
|
background: #7dbcea;
|
2016-12-30 21:41:28 +08:00
|
|
|
}
|
2019-12-24 15:01:03 +08:00
|
|
|
[data-theme="dark"] #components-layout-demo-basic .ant-layout-header {
|
|
|
|
background: #6aa0c7;
|
|
|
|
}
|
|
|
|
[data-theme="dark"] #components-layout-demo-basic .ant-layout-footer {
|
|
|
|
background: #6aa0c7;
|
|
|
|
}
|
2016-12-30 21:41:28 +08:00
|
|
|
#components-layout-demo-basic .ant-layout-footer {
|
|
|
|
line-height: 1.5;
|
|
|
|
}
|
|
|
|
#components-layout-demo-basic .ant-layout-sider {
|
|
|
|
color: #fff;
|
|
|
|
line-height: 120px;
|
2020-10-26 12:17:07 +08:00
|
|
|
background: #3ba0e9;
|
2016-12-30 21:41:28 +08:00
|
|
|
}
|
2019-12-24 15:01:03 +08:00
|
|
|
[data-theme="dark"] #components-layout-demo-basic .ant-layout-sider {
|
|
|
|
background: #3499ec;
|
|
|
|
}
|
2016-12-30 21:41:28 +08:00
|
|
|
#components-layout-demo-basic .ant-layout-content {
|
|
|
|
min-height: 120px;
|
2020-10-26 12:17:07 +08:00
|
|
|
color: #fff;
|
2016-12-30 21:41:28 +08:00
|
|
|
line-height: 120px;
|
2020-10-26 12:17:07 +08:00
|
|
|
background: rgba(16, 142, 233, 1);
|
2016-12-30 21:41:28 +08:00
|
|
|
}
|
2019-12-24 15:01:03 +08:00
|
|
|
[data-theme="dark"] #components-layout-demo-basic .ant-layout-content {
|
|
|
|
background: #107bcb;
|
|
|
|
}
|
2020-07-15 20:40:14 +08:00
|
|
|
#components-layout-demo-basic > .code-box-demo > .ant-layout + .ant-layout {
|
|
|
|
margin-top: 48px;
|
2016-12-30 21:41:28 +08:00
|
|
|
}
|
|
|
|
</style>
|