ant-design/components/tabs/demo/centered.tsx
lijianan a5e7c4e849
refactor: use Array.from() instead new Array() (#52792)
* refactor: use Array.from() instead new Array()

* chore: fix

* chore: fix
2025-02-14 10:16:15 +08:00

20 lines
371 B
TypeScript

import React from 'react';
import { Tabs } from 'antd';
const App: React.FC = () => (
<Tabs
defaultActiveKey="1"
centered
items={Array.from({ length: 3 }).map((_, i) => {
const id = String(i + 1);
return {
label: `Tab ${id}`,
key: id,
children: `Content of Tab Pane ${id}`,
};
})}
/>
);
export default App;