Skip to content
🌏 Translated with the assistance of DeepSeek and ChatGPT

Textarea

A very, very, very, very, very large amount of text can be entered here.

Basic Usage

You can enter multiple lines of text here. Pass in modelValue to enable controlled mode. If not passed or set to undefined, it will be uncontrolled mode, in which case you can use the defaultValue property as the default value.

Hide source code

Rows

The rows property controls the default number of rows. minRows and maxRows set the minimum and maximum number of rows. When autoResize is true, the height will adjust automatically.

Hide source code

Manual Resize

The resize property controls whether the manual resize handle is shown. It is shown by default.

Hide source code

More Options

Textarea also has some features of the Input component.

Disabled, Readonly, Loading & Clearable

Size

Count

0
0 / 255

Status

Expose

Hide source code

API

TextareaProps

AttributeTypeOptionalDefaultDescriptionVersion
modelValuestring | nullTrueValue of the textarea (controlled mode), supports v-model.0.0.2
defaultValuestring | nullTrueDefault value of the textarea (uncontrolled mode).0.0.2
rowsnumberTrueDefault number of rows.0.0.2
minRowsnumberTrue1Minimum number of rows.0.0.2
maxRowsnumberTrueInfinityMaximum number of rows.0.0.2
autoResizebooleanTruefalseWhether automatic resizing is allowed.0.0.2
resizebooleanTruetrueWhether manual resizing is allowed.0.0.2
placeholderstringTruePlaceholder text.0.0.2
disabledbooleanTruefalseDisabled state.0.0.2
readonlybooleanTruefalseRead-only state.0.0.2
clearablebooleanTruefalseWhether to show the clear button.0.0.2
loadingbooleanTruefalseWhether to show the loading state.0.0.2
size'medium' | 'large' | 'small'True'medium'Input box size.0.0.2
maxLengthnumberTrueMaximum input length.0.0.2
showCountbooleanTruefalseWhether to show character count.0.0.2
countGraphemes(value: string) => numberTrueCustom function for counting characters. If only countGraphemes is provided without sliceGraphemes, the maxLength limit will not take effect.0.0.2
sliceGraphemes(value: string, limit: number) => stringTrueCustom function for slicing the string.0.0.2
status'success' | 'warning' | 'error' | 'normal'True'normal'Form validation status.0.0.2
autofocusbooleanTruefalseNative <textarea> autofocus attribute.0.0.2
pollSizeChangebooleanTruefalseEnables polling for component size changes. This also affects the property of the same name in data input components that are child components.0.1.0

TextareaEvents

EventParameterDescriptionVersion
inputvalue: string, e: EventCallback when the textarea receives input.0.0.2
update:modelValuevalue: stringCallback to update modelValue.0.0.2
changevalue: string, e: Event | undefinedCallback when the input value changes.0.0.2
clearvalue: stringCallback when the clear button is clicked and the content is cleared.0.0.2
blure: FocusEventCallback when the textarea loses focus.0.0.2
focuse: FocusEventCallback when the textarea is focused.0.0.2

TextareaSlots

SlotParameterDescriptionVersion
countinputValue: number, currentLength: number, maxLength: numberSlot for displaying character count.0.0.2

TextareaExpose

AttributeTypeOptionalDefaultDescriptionVersion
focus() => voidFalseFocus the current textarea.0.0.2
blur() => voidFalseRemove focus from the current textarea.0.0.2
clear() => voidFalseClear the current textarea.0.0.2
select() => voidFalseSelect the content of the current textarea.0.0.2