fix className concat

This commit is contained in:
血诺 2015-11-12 21:28:02 +08:00
parent 8a62a4d009
commit 0c3432fd35

View File

@ -12,19 +12,25 @@ let AntSelect = React.createClass({
};
},
render() {
let sizeClass = '';
if (this.props.size === 'large') {
const {size, className, combobox, notFoundContent} = this.props;
let sizeClass = null;
if (size === 'large') {
sizeClass = 'ant-select-lg';
} else if (this.props.size === 'small') {
} else if (size === 'small') {
sizeClass = 'ant-select-sm';
}
let className = this.props.className || ' ';
let notFoundContent = this.props.notFoundContent;
if (this.props.combobox) {
notFoundContent = null;
const classNames = [];
if (className) {
classNames.push(className);
}
if (sizeClass) {
classNames.push(sizeClass);
}
return (
<Select {...this.props} className={className + sizeClass} notFoundContent={notFoundContent} />
<Select {...this.props} className={classNames.join(' ')} notFoundContent={combobox ? null : notFoundContent} />
);
}
});