Skip to content

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 ​

NameDescriptionTypeDefault
v-modelBinding valueString Number-
sizeSize of input numberStringmedium
disabledWhether the component is disabledBoolean-
readonlySame as readonly in native inputBooleanfalse
minThe minimum allowed valueNumber-Infinity
maxThe maximum allowed valueNumberInfinity
stepIncremental stepNumber1
step-strictlyWhether input value can only be multiple of stepBooleanfalse
precisionPrecision of input valueNumber-
controlsWhether to enable the control buttonsBooleantrue
controls-positionPosition of the control buttonsStringright
nameSame as name in native inputString-
labelSame as label in native inputString-
placeholderSame as placeholder in native inputString-
idSame as id in native inputString-
value-on-clearValue should be set when input box is clearedNumber Null String-
validate-eventWhether to trigger form validationBooleantrue

InputNumber Events ​

NameDescriptionType
changeTriggers when the value changesFunction
blurTriggers when Input blursFunction
focusTriggers when Input focusesFunction

InputNumber Exposes ​

NameDescriptionType
focusGet focus the input componentFunction
blurRemove focus the input componentFunction