mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-15 00:29:12 +08:00
1eee6d90ce
* feat: Tab Item support icon prop * Update package.json Signed-off-by: lijianan <574980606@qq.com> * fix: fix * fix: fix * fix: fix style * Update components/tabs/style/index.ts Co-authored-by: MadCcc <madccc@foxmail.com> Signed-off-by: lijianan <574980606@qq.com> * Update components/tabs/style/index.ts Co-authored-by: MadCcc <madccc@foxmail.com> Signed-off-by: lijianan <574980606@qq.com> --------- Signed-off-by: lijianan <574980606@qq.com> Co-authored-by: MadCcc <madccc@foxmail.com>
21 lines
454 B
TypeScript
21 lines
454 B
TypeScript
import React from 'react';
|
|
import { AndroidOutlined, AppleOutlined } from '@ant-design/icons';
|
|
import { Tabs } from 'antd';
|
|
|
|
const App: React.FC = () => (
|
|
<Tabs
|
|
defaultActiveKey="2"
|
|
items={[AppleOutlined, AndroidOutlined].map((Icon, i) => {
|
|
const id = String(i + 1);
|
|
return {
|
|
label: <span>Tab {id}</span>,
|
|
key: id,
|
|
children: `Tab ${id}`,
|
|
icon: <Icon />,
|
|
};
|
|
})}
|
|
/>
|
|
);
|
|
|
|
export default App;
|