2015-07-23 22:23:11 +08:00
|
|
|
import Tabs from 'rc-tabs';
|
|
|
|
import React from 'react';
|
|
|
|
const prefixCls = 'ant-tabs';
|
2015-06-12 12:01:02 +08:00
|
|
|
|
|
|
|
class AntTabs extends React.Component {
|
|
|
|
render() {
|
2015-10-21 19:58:54 +08:00
|
|
|
let className = (this.props.className || '');
|
2015-10-22 21:01:52 +08:00
|
|
|
if (this.props.size === 'small' || this.props.size === 'mini') {
|
2015-10-21 19:58:54 +08:00
|
|
|
className += ' ' + prefixCls + '-mini';
|
2015-06-19 17:26:24 +08:00
|
|
|
}
|
2015-10-21 19:58:54 +08:00
|
|
|
if (this.props.tabPosition === 'left' || this.props.tabPosition === 'right') {
|
|
|
|
className += ' ' + prefixCls + '-vertical';
|
|
|
|
}
|
|
|
|
return <Tabs {...this.props} className={className} />;
|
2015-06-12 12:01:02 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
AntTabs.defaultProps = {
|
2015-06-19 17:26:24 +08:00
|
|
|
prefixCls: prefixCls,
|
2015-10-22 21:01:52 +08:00
|
|
|
size: 'default'
|
2015-06-12 12:01:02 +08:00
|
|
|
};
|
|
|
|
|
2015-06-15 19:56:58 +08:00
|
|
|
AntTabs.TabPane = Tabs.TabPane;
|
2015-06-12 12:01:02 +08:00
|
|
|
|
2015-07-23 22:23:11 +08:00
|
|
|
export default AntTabs;
|