You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ant-design/components/tabs/index.jsx

32 lines
912 B
React

import Tabs from 'rc-tabs';
import React from 'react';
import classNames from 'classnames';
10 years ago
class AntTabs extends React.Component {
render() {
let { prefixCls, size, tabPosition, animation, type } = this.props;
let className = classNames({
[this.props.className]: !!this. props.className,
[prefixCls + '-mini']: size === 'small' || size === 'mini',
[prefixCls + '-vertical']: tabPosition === 'left' || tabPosition === 'right',
[prefixCls + '-' + type]: true,
});
if (tabPosition === 'left' || tabPosition === 'right' || type === 'card') {
animation = null;
}
return <Tabs {...this.props} className={className} animation={animation} />;
10 years ago
}
}
AntTabs.defaultProps = {
prefixCls: 'ant-tabs',
size: 'default',
animation: 'slide-horizontal',
type: 'line', // or 'card',
closable: false,
10 years ago
};
AntTabs.TabPane = Tabs.TabPane;
10 years ago
export default AntTabs;