feat: update input-number
parent
71300d0c00
commit
cb0a927273
|
@ -10,6 +10,7 @@
|
||||||
| min | min value | number | -Infinity |
|
| min | min value | number | -Infinity |
|
||||||
| parser | Specifies the value extracted from formatter | function( string): number | - |
|
| parser | Specifies the value extracted from formatter | function( string): number | - |
|
||||||
| precision | precision of input value | number | - |
|
| precision | precision of input value | number | - |
|
||||||
|
| decimalSeparator | decimal separator | string | - |
|
||||||
| size | width of input box | 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 |
|
| 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 | |
|
| value(v-model) | current value | number | |
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import PropTypes from '../_util/vue-types'
|
import PropTypes from '../_util/vue-types'
|
||||||
import { initDefaultProps, getOptionProps } from '../_util/props-util'
|
import { initDefaultProps, getOptionProps } from '../_util/props-util'
|
||||||
import classNames from 'classnames'
|
import classNames from 'classnames'
|
||||||
|
import Icon from '../icon'
|
||||||
import VcInputNumber from '../vc-input-number/src'
|
import VcInputNumber from '../vc-input-number/src'
|
||||||
|
|
||||||
export const InputNumberProps = {
|
export const InputNumberProps = {
|
||||||
|
@ -21,6 +22,7 @@ export const InputNumberProps = {
|
||||||
size: PropTypes.oneOf(['large', 'small', 'default']),
|
size: PropTypes.oneOf(['large', 'small', 'default']),
|
||||||
formatter: PropTypes.func,
|
formatter: PropTypes.func,
|
||||||
parser: PropTypes.func,
|
parser: PropTypes.func,
|
||||||
|
decimalSeparator: PropTypes.string,
|
||||||
placeholder: PropTypes.string,
|
placeholder: PropTypes.string,
|
||||||
name: PropTypes.string,
|
name: PropTypes.string,
|
||||||
id: PropTypes.string,
|
id: PropTypes.string,
|
||||||
|
@ -53,8 +55,13 @@ const InputNumber = {
|
||||||
[`${this.prefixCls}-lg`]: size === 'large',
|
[`${this.prefixCls}-lg`]: size === 'large',
|
||||||
[`${this.prefixCls}-sm`]: size === 'small',
|
[`${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 = {
|
const vcInputNumberprops = {
|
||||||
props: {
|
props: {
|
||||||
|
upHandler: upIcon,
|
||||||
|
downHandler: downIcon,
|
||||||
...others,
|
...others,
|
||||||
},
|
},
|
||||||
class: inputNumberClass,
|
class: inputNumberClass,
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
| min | 最小值 | number | -Infinity |
|
| min | 最小值 | number | -Infinity |
|
||||||
| parser | 指定从 formatter 里转换回数字的方式,和 formatter 搭配使用 | function( string): number | - |
|
| parser | 指定从 formatter 里转换回数字的方式,和 formatter 搭配使用 | function( string): number | - |
|
||||||
| precision | 数值精度 | number | - |
|
| precision | 数值精度 | number | - |
|
||||||
|
| decimalSeparator | 小数点 | string | - |
|
||||||
| size | 输入框大小 | string | 无 |
|
| size | 输入框大小 | string | 无 |
|
||||||
| step | 每次改变步数,可以为小数 | number\|string | 1 |
|
| step | 每次改变步数,可以为小数 | number\|string | 1 |
|
||||||
| value(v-model) | 当前值 | number | |
|
| value(v-model) | 当前值 | number | |
|
||||||
|
|
Loading…
Reference in New Issue