1. docs(components): [cascader] add version tag for togglePopperVisible expose 2. docs(components): [color-picker] add version tag for show & hide expose 3. docs(components): [date-picker] add version tag for handleOpen & handleClose method 4. docs(components): [dialog] add version tag for align-center atrr 5. docs(components): [dropdown] add version tag for teleported attr 6. docs(components): [form] add version tag for scroll-into-view-options attr 7. docs(components): [image] add version tag for zoom-rate attr 8. docs(components): [input-number] add version tag for readonly attr 9. docs(components): [menu] add version tag for popper-effect attr 10. docs(components): [message-box] add version tag for append-to attr & message function 11. docs(components): [rate] add version tag for clearable attr 12. docs(components): [select-v2] add max-collapse-tags attr 13. docs(components): [select] add version tag for collapse-tags-tooltip & placement 14. docs(components): [table] fix show-overflow-toolip attr version tag 15. docs(components): [time-picker] add version tag for handleOption & handleClose expose 16. docs(components): [tree-v2] add version tag for item-size attr 17. docs(components): [tree] add version tag for empty slot
5.0 KiB
title, lang
| title | lang |
|---|---|
| Input | en-US |
Input Number
Input numerical values with a customizable range.
Basic usage
:::demo Bind a variable to v-model in <el-input-number> element and you are set.
input-number/basic
:::
:::tip
When inputting invalid string to the input box, input value will emit NaN to the upper layer as result of error
:::
Disabled
:::demo The disabled attribute accepts a boolean, and if the value is true, the component is disabled. If you just need to control the value within a range, you can add min attribute to set the minimum value and max to set the maximum value. By default, the minimum value is 0.
input-number/disabled
:::
Steps
Allows you to define incremental steps.
:::demo Add step attribute to set the step.
input-number/steps
:::
Step strictly
:::demo The step-strictly attribute accepts a boolean. if this attribute is true, input value can only be multiple of step.
input-number/step-strictly
:::
Precision
:::demo Add precision attribute to set the precision of input value.
input-number/precision
:::
:::tip
The value of precision must be a non negative integer and should not be less than the decimal places of step.
:::
Size
Use attribute size to set additional sizes with large or small.
:::demo
input-number/size
:::
Controls Position
:::demo Set controls-position to decide the position of control buttons.
input-number/controlled
:::
API
Attributes
| Name | Description | Type | Default |
|---|---|---|---|
| model-value / v-model | binding value | ^[number] | — |
| min | the minimum allowed value | ^[number] | -Infinity |
| max | the maximum allowed value | ^[number] | Infinity |
| step | incremental step | ^[number] | 1 |
| step-strictly | whether input value can only be multiple of step | ^[boolean] | false |
| precision | precision of input value | ^[number] | — |
| size | size of the component | ^[enum]'large' | 'default' | 'small' |
default |
| readonly ^(2.2.16) | same as readonly in native input |
^[boolean] | false |
| disabled | whether the component is disabled | ^[boolean] | false |
| controls | whether to enable the control buttons | ^[boolean] | true |
| controls-position | position of the control buttons | ^[enum]'' | 'right' |
— |
| name | same as name in native input |
^[string] | — |
| label | same as label in native input |
^[string] | — |
| placeholder | same as placeholder in native input |
^[string] | — |
| id | same as id in native input |
^[string] | — |
| value-on-clear ^(2.2.0) | value should be set when input box is cleared | ^[number] / ^[null] / ^[enum]'min' | 'max' |
— |
| validate-event | whether to trigger form validation | ^[boolean] | true |
Events
| Name | Description | Type |
|---|---|---|
| change | triggers when the value changes | ^[Function](currentValue: number | undefined, oldValue: number | undefined) => void |
| blur | triggers when Input blurs | ^[Function](event: FocusEvent) => void |
| focus | triggers when Input focuses | ^[Function](event: FocusEvent) => void |
Exposes
| Name | Description | Type |
|---|---|---|
| focus | get focus the input component | ^[Function]() => void |
| blur | remove focus the input component | ^[Function]() => void |