import React from 'react'; import { Tabs } from 'antd'; import router from 'umi/router'; import Operation from './components/operation'; import Business from './components/business'; import styles from './index.less'; const { TabPane } = Tabs; const index = props => { // console.log(props); /** * 切换tab页签 * @param {*} key */ function onChangeTab(key) { router.push(key); } const { location: { hash }, } = props; return ( <div className={styles.root}> <Tabs defaultActiveKey={hash || '#operation'} onChange={onChangeTab}> <TabPane tab="运维参数管理" key="#operation"> <Operation /> </TabPane> <TabPane tab="业务参数管理" key="#business"> <Business /> </TabPane> </Tabs> </div> ); }; export default index;