ant-design/components/tabs/index.jsx

26 lines
643 B
React
Raw Normal View History

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 || '');
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,
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
export default AntTabs;