2017-09-06 15:53:25 +08:00
---
order: 0
title:
zh-CN: 简单列表
2017-10-13 11:40:49 +08:00
en-US: Simple list
2017-09-06 15:53:25 +08:00
---
## zh-CN
2017-09-26 16:11:35 +08:00
列表拥有大、中、小三种尺寸。
通过设置 `size` 为 `large` `small` 分别把按钮设为大、小尺寸。若不设置 `size` ,则尺寸为中。
可通过设置 `header` 和 `footer` ,来自定义列表头部和尾部。
2017-09-06 15:53:25 +08:00
## en-US
2017-10-13 11:40:49 +08:00
Ant Design supports a default list size as well as a large and small size.
If a large or small list is desired, set the size property to either large or small respectively. Omit the size property for a list with the default size.
Customizing the header and footer of list by setting `header` and `footer` property.
2017-09-06 15:53:25 +08:00
````jsx
2019-03-05 22:17:22 +08:00
import { List, Typography } from 'antd';
2017-09-06 15:53:25 +08:00
2017-09-25 15:24:16 +08:00
const data = [
'Racing car sprays burning fuel into crowd.',
'Japanese princess to wed commoner.',
'Australian walks 100km after outback crash.',
'Man charged over missing wedding girl.',
'Los Angeles battles huge wildfires.',
];
2017-09-06 15:53:25 +08:00
ReactDOM.render(
2017-09-26 16:11:35 +08:00
< div >
2017-09-27 22:32:49 +08:00
< h3 style = {{ marginBottom: 16 } } > Default Size< / h3 >
2017-09-26 16:11:35 +08:00
< List
2017-09-27 22:32:49 +08:00
header={< div > Header< / div > }
footer={< div > Footer< / div > }
2017-09-26 16:11:35 +08:00
bordered
dataSource={data}
2019-03-06 16:36:40 +08:00
renderItem={item => (< List.Item > < Typography.Text mark > [ITEM]< / Typography.Text > {item}< / List.Item > )}
2017-09-26 16:11:35 +08:00
/>
2017-09-27 22:32:49 +08:00
< h3 style = {{ margin: ' 16px 0 ' } } > Small Size< / h3 >
2017-09-26 16:11:35 +08:00
< List
2017-09-27 22:32:49 +08:00
size="small"
2017-09-26 16:11:35 +08:00
header={< div > Header< / div > }
footer={< div > Footer< / div > }
bordered
dataSource={data}
renderItem={item => (< List.Item > {item}< / List.Item > )}
/>
< h3 style = {{ margin: ' 16px 0 ' } } > Large Size< / h3 >
< List
2017-09-27 22:32:49 +08:00
size="large"
header={< div > Header< / div > }
footer={< div > Footer< / div > }
2017-09-26 16:11:35 +08:00
bordered
dataSource={data}
renderItem={item => (< List.Item > {item}< / List.Item > )}
/>
2018-06-27 15:55:04 +08:00
< / div > ,
2018-11-28 15:00:03 +08:00
mountNode
);
2017-09-06 15:53:25 +08:00
````