A2UI 文本域 Textarea
通过 Schema 配置生成 XTextarea 多行文本域组件。
字段配置
json
{
"name": "bio",
"label": "简介",
"type": "textarea",
"props": {
"placeholder": "请输入简介",
"rows": 4,
"maxlength": 500,
"showWordLimit": true,
"autosize": { "minRows": 2, "maxRows": 6 }
},
"rules": [
{ "type": "required", "message": "简介必填" }
]
}Props 配置
| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| placeholder | string | - | 占位文本 |
| rows | number | 2 | 默认行数 |
| maxlength | number | - | 最大输入长度 |
| showWordLimit | boolean | false | 显示字数统计 |
| autosize | object/boolean | false | 自适应高度 |
| disabled | boolean | false | 禁用状态 |
| resize | string | 'vertical' | resize 属性 |
autosize 配置
json
"autosize": { "minRows": 2, "maxRows": 8 }示例
基础文本域
json
{ "name": "content", "label": "内容", "type": "textarea" }自适应高度
json
{ "name": "description", "label": "描述", "type": "textarea", "props": { "autosize": true } }带字数限制
json
{ "name": "comment", "label": "评论", "type": "textarea", "props": { "maxlength": 200, "showWordLimit": true } }渲染组件
A2UI Textarea 字段会渲染为 XTO UI 的 XTextarea 组件:
vue
<XTextarea
v-model="formData.bio"
placeholder="请输入简介"
:rows="4"
/>相关链接
- XTextarea 组件文档 - XTO UI 文本域详细说明
- A2UI 表单 - 表单整体配置