InputNumber
Input numerical values with a customizable range.
Basic usage
Bind a variable to v-model in <tu-input-number> element and you are set.
Disabled
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.
Steps
Allows you to define incremental steps.
Step strictly
The step-strictly attribute accepts a boolean. if this attribute is true, input value can only be multiple of step.
Precision
Add precision attribute to set the precision of input value.
Controls Position
Setting the controls-position to decide the position of control buttons.
Sizes
Besides default size, tu-input-number component provides three additional sizes for you to choose among different scenarios. Use attribute size to set additional sizes with mini, small, large.
InputNumber API
InputNumber Attributes
Name | Description | Type | Default |
---|---|---|---|
v-model | Binding value | String Number | - |
size | Size of input number | String | medium |
disabled | Whether the component is disabled | Boolean | - |
readonly | Same as readonly in native input | Boolean | false |
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 | - |
controls | Whether to enable the control buttons | Boolean | true |
controls-position | Position of the control buttons | String | 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 | Value should be set when input box is cleared | Number Null String | - |
validate-event | Whether to trigger form validation | Boolean | true |
InputNumber Events
Name | Description | Type |
---|---|---|
change | Triggers when the value changes | Function |
blur | Triggers when Input blurs | Function |
focus | Triggers when Input focuses | Function |
InputNumber Exposes
Name | Description | Type |
---|---|---|
focus | Get focus the input component | Function |
blur | Remove focus the input component | Function |