2015-06-12 12:01:02 +08:00
|
|
|
# 基本
|
|
|
|
|
2015-06-17 20:28:02 +08:00
|
|
|
- order: 0
|
2015-06-12 12:01:02 +08:00
|
|
|
|
2015-08-06 16:47:01 +08:00
|
|
|
默认选中第一项。
|
2015-06-12 12:01:02 +08:00
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
````jsx
|
2015-10-28 20:55:49 +08:00
|
|
|
import { Tabs } from 'antd';
|
|
|
|
const TabPane = Tabs.TabPane;
|
2015-06-12 12:01:02 +08:00
|
|
|
|
2015-06-17 20:28:02 +08:00
|
|
|
function callback(key) {
|
|
|
|
console.log(key);
|
|
|
|
}
|
2015-06-12 12:01:02 +08:00
|
|
|
|
2015-10-20 16:47:55 +08:00
|
|
|
ReactDOM.render(
|
2015-08-06 16:47:01 +08:00
|
|
|
<Tabs defaultActiveKey="1" onChange={callback}>
|
|
|
|
<TabPane tab="选项卡一" key="1">选项卡一内容</TabPane>
|
|
|
|
<TabPane tab="选项卡二" key="2">选项卡二内容</TabPane>
|
|
|
|
<TabPane tab="选项卡三" key="3">选项卡三内容</TabPane>
|
2015-06-15 19:56:58 +08:00
|
|
|
</Tabs>
|
|
|
|
, document.getElementById('components-tabs-demo-basic'));
|
2015-06-12 12:01:02 +08:00
|
|
|
````
|