mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-22 22:48:29 +08:00
24 lines
431 B
TypeScript
24 lines
431 B
TypeScript
|
import React from 'react';
|
||
|
import { Tabs } from 'antd';
|
||
|
|
||
|
const onChange = (key: string) => {
|
||
|
console.log(key);
|
||
|
};
|
||
|
|
||
|
const App: React.FC = () => (
|
||
|
<Tabs
|
||
|
onChange={onChange}
|
||
|
type="card"
|
||
|
items={new Array(3).fill(null).map((_, i) => {
|
||
|
const id = String(i + 1);
|
||
|
return {
|
||
|
label: `Tab ${id}`,
|
||
|
key: id,
|
||
|
children: `Content of Tab Pane ${id}`,
|
||
|
};
|
||
|
})}
|
||
|
/>
|
||
|
);
|
||
|
|
||
|
export default App;
|