mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-15 17:31:25 +08:00
38 lines
539 B
Markdown
38 lines
539 B
Markdown
|
---
|
||
|
order: 0
|
||
|
title:
|
||
|
zh-CN: 设置图标
|
||
|
en-US: With Icon
|
||
|
---
|
||
|
|
||
|
## zh-CN
|
||
|
|
||
|
给 Segmented Item 设置 Icon。
|
||
|
|
||
|
## en-US
|
||
|
|
||
|
Set `icon` for Segmented Item.
|
||
|
|
||
|
```jsx
|
||
|
import { Segmented } from 'antd';
|
||
|
import { AppstoreOutlined, BarsOutlined } from '@ant-design/icons';
|
||
|
|
||
|
ReactDOM.render(
|
||
|
<Segmented
|
||
|
options={[
|
||
|
{
|
||
|
label: 'List',
|
||
|
value: 'List',
|
||
|
icon: <BarsOutlined />,
|
||
|
},
|
||
|
{
|
||
|
label: 'Kanban',
|
||
|
value: 'Kanban',
|
||
|
icon: <AppstoreOutlined />,
|
||
|
},
|
||
|
]}
|
||
|
/>,
|
||
|
mountNode,
|
||
|
);
|
||
|
```
|