ant-design/components/tabs/index.jsx

29 lines
764 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 || '');
let animation = this.props.animation;
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';
animation = null;
2015-10-21 19:58:54 +08:00
}
return <Tabs {...this.props} className={className} animation={animation}/>;
2015-06-12 12:01:02 +08:00
}
}
AntTabs.defaultProps = {
2015-06-19 17:26:24 +08:00
prefixCls: prefixCls,
size: 'default',
animation: 'slide-horizontal',
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;