feat: update input-number

pull/309/head
tangjinzhou 2018-12-09 11:49:18 +08:00
parent 71300d0c00
commit cb0a927273
3 changed files with 9 additions and 0 deletions

View File

@ -10,6 +10,7 @@
| min | min value | number | -Infinity |
| parser | Specifies the value extracted from formatter | function( string): number | - |
| precision | precision of input value | number | - |
| decimalSeparator | decimal separator | string | - |
| size | width of input box | string | - |
| step | The number to which the current value is increased or decreased. It can be an integer or decimal. | number\|string | 1 |
| value(v-model) | current value | number | |

View File

@ -1,6 +1,7 @@
import PropTypes from '../_util/vue-types'
import { initDefaultProps, getOptionProps } from '../_util/props-util'
import classNames from 'classnames'
import Icon from '../icon'
import VcInputNumber from '../vc-input-number/src'
export const InputNumberProps = {
@ -21,6 +22,7 @@ export const InputNumberProps = {
size: PropTypes.oneOf(['large', 'small', 'default']),
formatter: PropTypes.func,
parser: PropTypes.func,
decimalSeparator: PropTypes.string,
placeholder: PropTypes.string,
name: PropTypes.string,
id: PropTypes.string,
@ -53,8 +55,13 @@ const InputNumber = {
[`${this.prefixCls}-lg`]: size === 'large',
[`${this.prefixCls}-sm`]: size === 'small',
})
const upIcon = <Icon type='up' class={`${this.prefixCls}-handler-up-inner`}/>
const downIcon = <Icon type='down' class={`${this.prefixCls}-handler-down-inner`}/>
const vcInputNumberprops = {
props: {
upHandler: upIcon,
downHandler: downIcon,
...others,
},
class: inputNumberClass,

View File

@ -12,6 +12,7 @@
| min | 最小值 | number | -Infinity |
| parser | 指定从 formatter 里转换回数字的方式,和 formatter 搭配使用 | function( string): number | - |
| precision | 数值精度 | number | - |
| decimalSeparator | 小数点 | string | - |
| size | 输入框大小 | string | 无 |
| step | 每次改变步数,可以为小数 | number\|string | 1 |
| value(v-model) | 当前值 | number | |