VInputNumber
VInputNumber is an extended numeric input with optional unit display, text alignment control, and custom prefix/suffix or control-icon slots.
Basic Usage
Basic numeric input with step controls.
With Unit
Use unit to render a visual unit label without changing the emitted numeric value.
Alignment
Use align to control the inner text alignment.
Behavior Notes
- While typing, the component keeps the raw input text and normalizes it on
change/blur. - Clearing the input returns
nullby default. Usevalue-on-clearto returnmin,max, or a custom number instead. - When
step-strictlyis enabled, committed values are rounded to the nearest multiple ofstep. - Values committed outside
[min, max]are clamped back into range. unitonly affects the visual label rendered beside the input.- Scientific notation such as
1e3is not supported.
API
VInputNumber Attributes
| Name | Description | Type | Default |
|---|---|---|---|
| model-value / v-model | binding value | number / null | — |
| min | minimum allowed value | number | Number.MIN_SAFE_INTEGER |
| max | maximum allowed value | number | Number.MAX_SAFE_INTEGER |
| step | incremental step | number | 1 |
| step-strictly | whether the committed value must be a multiple of step | boolean | false |
| precision | precision of the committed value | number | — |
| size | component size | enum | — |
| readonly | same as native readonly | boolean | false |
| disabled | disable the input; also inherits disabled state from parent el-form | boolean | false |
| controls | whether to show increase/decrease buttons | boolean | true |
| controls-position | position of the control buttons | enum | 'right' |
| value-on-clear | value used when the input is cleared | enum / number / null | null |
| name | same as native name | string | — |
| placeholder | same as native placeholder | string | — |
| id | same as native id | string | — |
| title | same as native title | string | — |
| maxlength | same as native maxlength | string / number | — |
| minlength | same as native minlength | string / number | — |
| validate-event | whether to trigger parent form-item validation on change and blur | boolean | true |
| aria-label | native aria-label attribute | string | — |
| inputmode | native inputmode attribute | string | — |
| align | alignment for the inner input text | enum | 'left' |
| unit | visual unit label displayed beside the input | string | '' |
VInputNumber Events
| Name | Description | Type |
|---|---|---|
| update:model-value | triggered when the normalized value changes | function |
| change | triggered after a value change is committed | function |
| blur | triggered when input loses focus | function |
| focus | triggered when input gains focus | function |
| input | triggered while typing or using controls | function |
VInputNumber Slots
| Name | Description |
|---|---|
| prefix | prefix content |
| suffix | suffix content |
| decrease-icon | custom decrease button icon |
| increase-icon | custom increase button icon |
Exposes
| Name | Description | Type |
|---|---|---|
| focus | get focus the input component | Function |
| blur | remove focus the input component | Function |