mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-15 00:29:12 +08:00
b0dd138fba
* feat: ConfigProvider support tabs.indicatorLength
* feat: ConfigProvider support card.tabProps
* Revert "feat: ConfigProvider support card.tabProps"
This reverts commit 817af9a6bb
.
* chore: rename
* docs: add demo
37 lines
620 B
TypeScript
37 lines
620 B
TypeScript
import React from 'react';
|
|
import { Tabs } from 'antd';
|
|
import type { TabsProps } from 'antd';
|
|
|
|
const onChange = (key: string) => {
|
|
console.log(key);
|
|
};
|
|
|
|
const items: TabsProps['items'] = [
|
|
{
|
|
key: '1',
|
|
label: 'Tab 1',
|
|
children: 'Content of Tab Pane 1',
|
|
},
|
|
{
|
|
key: '2',
|
|
label: 'Tab 2',
|
|
children: 'Content of Tab Pane 2',
|
|
},
|
|
{
|
|
key: '3',
|
|
label: 'Tab 3',
|
|
children: 'Content of Tab Pane 3',
|
|
},
|
|
];
|
|
|
|
const App: React.FC = () => (
|
|
<Tabs
|
|
defaultActiveKey="1"
|
|
items={items}
|
|
onChange={onChange}
|
|
indicatorSize={(origin) => origin - 16}
|
|
/>
|
|
);
|
|
|
|
export default App;
|