mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-02 12:09:14 +08:00
use svg icon in input-number component
This commit is contained in:
parent
010bdebc28
commit
318528dc4f
@ -1,7 +1,7 @@
|
||||
import * as React from 'react';
|
||||
import classNames from 'classnames';
|
||||
import RcInputNumber from 'rc-input-number';
|
||||
|
||||
import Icon from '../icon';
|
||||
import { Omit } from '../_util/type';
|
||||
|
||||
// omitting this attrs because they conflicts with the ones defined in InputNumberProps
|
||||
@ -42,8 +42,18 @@ export default class InputNumber extends React.Component<InputNumberProps, any>
|
||||
[`${this.props.prefixCls}-lg`]: size === 'large',
|
||||
[`${this.props.prefixCls}-sm`]: size === 'small',
|
||||
}, className);
|
||||
const upIcon = <Icon type="up" className={`${this.props.prefixCls}-handler-up-inner`}/>;
|
||||
const downIcon = <Icon type="down" className={`${this.props.prefixCls}-handler-down-inner`}/>;
|
||||
|
||||
return <RcInputNumber ref={(c: any) => this.inputNumberRef = c} className={inputNumberClass} {...others} />;
|
||||
return (
|
||||
<RcInputNumber
|
||||
ref={(c: any) => this.inputNumberRef = c}
|
||||
className={inputNumberClass}
|
||||
upHandler={upIcon}
|
||||
downHandler={downIcon}
|
||||
{...others}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
focus() {
|
||||
|
@ -124,10 +124,7 @@
|
||||
&-inner {
|
||||
top: 50%;
|
||||
margin-top: -6px;
|
||||
&:before {
|
||||
text-align: center;
|
||||
content: "\e61e";
|
||||
}
|
||||
text-align: center;
|
||||
}
|
||||
&:hover {
|
||||
height: 60% !important;
|
||||
@ -141,10 +138,7 @@
|
||||
&-inner {
|
||||
top: 50%;
|
||||
margin-top: -6px;
|
||||
&:before {
|
||||
text-align: center;
|
||||
content: "\e61d";
|
||||
}
|
||||
text-align: center;
|
||||
}
|
||||
&:hover {
|
||||
height: 60% !important;
|
||||
|
Loading…
Reference in New Issue
Block a user