1.在需要使用的页面导入
import {Tabs} from 'antd'
const { TabPane } = Tabs;
2.使用
<Tabs defaultActiveKey="1" onChange={this.callback}>
<TabPane tab="Tab 1" key="1">
Content of Tab Pane 1
</TabPane>
<TabPane tab="Tab 2" key="2">
Content of Tab Pane 2
</TabPane>
</Tabs>,
callback(key){
console.log(key)
}