mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-13 07:39:10 +08:00
628968f460
* refactor: Using items * docs: replace with items * docs: deprecated demo * test: Update snapshot * docs: simple basic demo * test: coverage
43 lines
627 B
Markdown
43 lines
627 B
Markdown
---
|
|
order: 2
|
|
title:
|
|
zh-CN: 图标
|
|
en-US: Icon
|
|
---
|
|
|
|
## zh-CN
|
|
|
|
有图标的标签。
|
|
|
|
## en-US
|
|
|
|
The Tab with Icon.
|
|
|
|
```tsx
|
|
import { AndroidOutlined, AppleOutlined } from '@ant-design/icons';
|
|
import { Tabs } from 'antd';
|
|
import React from 'react';
|
|
|
|
const App: React.FC = () => (
|
|
<Tabs
|
|
defaultActiveKey="2"
|
|
items={[AppleOutlined, AndroidOutlined].map((Icon, i) => {
|
|
const id = String(i + 1);
|
|
|
|
return {
|
|
label: (
|
|
<span>
|
|
<Icon />
|
|
Tab {id}
|
|
</span>
|
|
),
|
|
key: id,
|
|
children: `Tab ${id}`,
|
|
};
|
|
})}
|
|
/>
|
|
);
|
|
|
|
export default App;
|
|
```
|