Skip to content

Textarea

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 Textarea with the disabled attribute.

Allow clear

Make the Textarea allow clear with the allowClear attribute.

Formatter

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

Limit length

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

0 / 10

Autosize textarea

Setting the autosize prop for a textarea type of Input makes the height to automatically adjust based on the content. An options object can be provided to autosize to specify the minimum and maximum number of lines the textarea can automatically adjust.

Sizes

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

Textarea API

Textarea Attributes

NameDescriptionTypeDefault
v-modelBinding valueString Number-
sizeSize of TextareaStringmedium
disabledWhether textarea is disabledBoolean-
maxlengthThe max lengthString Number-
minlengthThe min lengthNumber-
show-word-limitWhether show word count, only works when type is 'text'Booleanfalse
placeholderPlaceholder of TextareaString-
allow-clearWhether to show clear buttonBoolean-
rowsNumber of rows of textareanumber-
autosizeWhether textarea has an adaptive height. Can accept an object, e.g:{minRows: 2, maxRows: 6}.boolean objectfalse
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-
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
textarea-styleThe style of the textarea element or textarea elementString Object{}

Textarea Events

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

Textarea Exposes

NameDescriptionType
focusFocus the Textarea elementFunction
blurBlur the Textarea elementFunction
clearClear Textarea valueFunction
textareaHTML Textarea elementobject
refHTML elementobject
selectSelect the text in Textarea elementFunction
resizeTextareaResize textareaFunction
textareaStyleStyle of textareaobject