mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-16 01:29:11 +08:00
628968f460
* refactor: Using items * docs: replace with items * docs: deprecated demo * test: Update snapshot * docs: simple basic demo * test: coverage
37 lines
498 B
Markdown
37 lines
498 B
Markdown
---
|
|
order: 2
|
|
title:
|
|
zh-CN: 居中
|
|
en-US: Centered
|
|
---
|
|
|
|
## zh-CN
|
|
|
|
标签居中展示。
|
|
|
|
## en-US
|
|
|
|
Centered tabs.
|
|
|
|
```tsx
|
|
import { Tabs } from 'antd';
|
|
import React from 'react';
|
|
|
|
const App: React.FC = () => (
|
|
<Tabs
|
|
defaultActiveKey="1"
|
|
centered
|
|
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;
|
|
```
|