ant-design/components/list/demo/basic.md

53 lines
847 B
Markdown
Raw Normal View History

---
order: 1
title:
2018-04-13 14:59:22 +08:00
zh-CN: 基础列表
en-US: Basic list
---
## zh-CN
基础列表。
## en-US
Basic list.
```tsx
2022-05-21 22:14:15 +08:00
import { Avatar, List } from 'antd';
import React from 'react';
const data = [
{
title: 'Ant Design Title 1',
},
{
title: 'Ant Design Title 2',
},
{
title: 'Ant Design Title 3',
},
{
title: 'Ant Design Title 4',
},
];
const App: React.FC = () => (
<List
itemLayout="horizontal"
dataSource={data}
renderItem={item => (
<List.Item>
<List.Item.Meta
avatar={<Avatar src="https://joeschmoe.io/api/v1/random" />}
title={<a href="https://ant.design">{item.title}</a>}
description="Ant Design, a design language for background applications, is refined by Ant UED Team"
/>
</List.Item>
)}
/>
2018-11-28 15:00:03 +08:00
);
export default App;
2019-05-07 14:57:32 +08:00
```