mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-25 03:29:59 +08:00
Merge pull request #592 from ant-design/fix-input-number
fix: InputNumber should support `className`
This commit is contained in:
commit
2f2928979b
@ -1,5 +1,6 @@
|
||||
import InputNumber from 'rc-input-number';
|
||||
import React from 'react';
|
||||
import classNames from 'classnames';
|
||||
import InputNumber from 'rc-input-number';
|
||||
|
||||
export default React.createClass({
|
||||
getDefaultProps() {
|
||||
@ -9,12 +10,13 @@ export default React.createClass({
|
||||
};
|
||||
},
|
||||
render() {
|
||||
let sizeClass = '';
|
||||
if (this.props.size === 'large') {
|
||||
sizeClass = 'ant-input-number-lg';
|
||||
} else if (this.props.size === 'small') {
|
||||
sizeClass = 'ant-input-number-sm';
|
||||
}
|
||||
return <InputNumber className={sizeClass} {...this.props} />;
|
||||
const {className, size, ...other} = this.props;
|
||||
const inputNumberClass = classNames({
|
||||
'ant-input-number-lg': size === 'large',
|
||||
'ant-input-number-sm': size === 'small',
|
||||
[className]: !!className,
|
||||
});
|
||||
|
||||
return <InputNumber className={inputNumberClass} {...other} />;
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user