mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-04 17:09:46 +08:00
eee3b50727
* feat: support icon only with segmented * fix: lint issue * chore: update * test: fix * test: update snapshot
37 lines
531 B
Markdown
37 lines
531 B
Markdown
---
|
|
order: 7
|
|
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';
|
|
|
|
export default () => (
|
|
<Segmented
|
|
options={[
|
|
{
|
|
label: 'List',
|
|
value: 'List',
|
|
icon: <BarsOutlined />,
|
|
},
|
|
{
|
|
label: 'Kanban',
|
|
value: 'Kanban',
|
|
icon: <AppstoreOutlined />,
|
|
},
|
|
]}
|
|
/>
|
|
);
|
|
```
|