Textarea 文本域
Form · Interactive component
Multi-line text with character counting.
On-demand import
wbbb-ui/components/textareaBasic Usage
<script setup lang="ts">
import { ref } from 'vue'
import { WbbbTextarea } from 'wbbb-ui/components/textarea'
import 'wbbb-ui/styles/textarea'
const value = ref('')
</script>
<template>
<WbbbTextarea v-model="value" />
</template>States and Interaction
All listed states can be operated and verified in the live Playground preview.
DefaultFilledFocusDisabledError
API Reference
Props
| Property | Description | Type | Default | Required |
|---|---|---|---|---|
autoHeight | Makes the textarea grow with its content. | boolean | false | No |
disabled | Prevents user interaction with the component. | boolean | false | No |
error | Shows the component in its error visual state. | boolean | false | No |
maxlength | Limits the number of characters that can be entered. | number | 200 | No |
modelValue | Provides the current value used by v-model. | string | '' | No |
placeholder | Sets placeholder text when no value is present. | string | '' | No |
readonly | Prevents editing while keeping the value readable. | boolean | false | No |
showCount | Shows the current character count. | boolean | false | No |
Events
update:modelValueblurchangefocus
Slots
None
Two-way binding
Supports v-model (modelValue).
Platform Notes
Build verification: H5, App Vue, WeChat Mini Program, Alipay Mini Program, and Douyin Mini Program.
Runtime differences: H5 supports keyboard focus and reduced motion. Mini Programs provide equivalent touch interaction; verify upload, date selection, and overlays on target platforms.
Usage note: Use Playground to verify further state combinations and cross-platform behavior.
