Skip to content

Input ​

The basic form components have been expanded on the basis of native controls and can be used in combination.

Basic usage ​

Input data using mouse or keyboard.

Disabled ​

Disable the Input with the disabled attribute.

Allow clear ​

Make the Input allow clear with the allowClear attribute.

Formatter ​

Display value within its situation with formatter, and we usually use parser at the same time.

Password box ​

Make a toggle-able password Input with the show-password attribute.

Input with icon ​

Add an icon to indicate input type.

Attribute

Slot

Mixed input ​

Prepend or append an element, generally a label or a button.

Http://
Com

Limit length ​

maxlength and minlength attributes of input, they declare a limit on the number of characters a user can input.

0 / 10

Sizes ​

Besides default size, tu-input component provides three additional sizes for you to choose among different scenarios. Use attribute size to set additional sizes with mini, small, large.

Input API ​

Input Attributes ​

NameDescriptionTypeDefault
v-modelBinding valueString Number-
typeType of inputStringtext
sizeSize of InputStringmedium
disabledWhether Input is disabledBoolean-
maxlengthThe max lengthString Number-
minlengthThe min lengthNumber-
show-word-limitWhether show word count, only works when type is 'text'Booleanfalse
placeholderPlaceholder of InputString-
allow-clearWhether to show clear buttonBoolean-
formatterSpecifies the format of the value presented input.(only works when type is 'text')Function-
parserSpecifies the value extracted from formatter input.(only works when type is 'text')Function-
show-passwordWhether to show toggleable password inputBoolean-
prefix-iconPrefix icon componentString Component-
suffix-iconSuffix icon componentString Component-
nameSame as name in native inputString-
readonlySame as readonly in native inputBooleanfalse
maxSame as max in native input--
minSame as min in native input--
stepSame as step in native input--
autofocusSame as autofocus in native inputBooleanfalse
formSame as form in native inputString-
tabindexInput tabindexString Number-
validate-eventWhether to trigger form validationBooleantrue
input-styleThe style of the input elementString Object{}

Input Events ​

NameDescriptionType
blurTriggers when Input blursFunction
focusTriggers when Input focusesFunction
changeTriggers when the input box loses focus or the user presses Enter, only if the modelValue has changedFunction
inputTriggers when the Input value changeFunction
clearTriggers when the Input is cleared by clicking the clear buttonFunction

Input Slots ​

NameDescription
prefixContent as Input prefix
suffixContent as Input suffix
prependContent to prepend before Input
appendContent to append after Input

Input Exposes ​

NameDescriptionType
focusFocus the Input elementFunction
blurBlur the Input elementFunction
clearClear Input valueFunction
inputHTML Input elementobject
refHTML elementobject
selectSelect the text in input elementFunction