Textarea 多行文本输入框

基本使用

```schema: scope=”body” { “type”: “form”, “api”: “/api/mock2/form/saveForm”, “body”: [ { “name”: “textarea”, “type”: “textarea”, “label”: “多行文本” } ] }

  1. ## 清空输入框
  2. 带移除图标的输入框,点击图标删除所有内容。
  3. ```schema: scope="body"
  4. {
  5. "type": "form",
  6. "api": "/api/mock2/form/saveForm",
  7. "body": [
  8. {
  9. "name": "textarea",
  10. "type": "textarea",
  11. "label": "多行文本",
  12. "clearable": true
  13. }
  14. ]
  15. }

设置resetValue,清空输入框后重置为指定值

```schema: scope=”body” { “type”: “form”, “api”: “/api/mock2/form/saveForm”, “body”: [ { “name”: “textarea”, “type”: “textarea”, “label”: “多行文本”, “clearable”: true, “resetValue”: “reset” } ] }

  1. ## 显示计数器
  2. ```schema: scope="body"
  3. {
  4. "type": "form",
  5. "body": [
  6. {
  7. "name": "a",
  8. "type": "textarea",
  9. "label": "A",
  10. "showCounter": true,
  11. "placeholder": "请输入",
  12. "clearable": true
  13. },
  14. {
  15. "name": "b",
  16. "type": "textarea",
  17. "label": "B",
  18. "showCounter": true,
  19. "maxLength": 100,
  20. "placeholder": "请输入"
  21. }
  22. ]
  23. }

属性表

当做选择器表单项使用时,除了支持 普通表单项属性表 中的配置以外,还支持下面一些配置

属性名 类型 默认值 说明
minRows number 3 最小行数
maxRows number 20 最大行数
trimContents boolean true 是否去除首尾空白文本
readOnly boolean false 是否只读
showCounter boolean false 是否显示计数器
maxLength number - 限制最大字数
clearable boolean false 是否可清除
resetValue string "" 清除后设置此配置项给定的值。

事件表

当前组件会对外派发以下事件,可以通过onEvent来监听这些事件,并通过actions来配置执行的动作,在actions中可以通过event.data.xxx事件参数变量来获取事件产生的数据,详细请查看事件动作

事件名称 事件参数 说明
change event.data.value: string 输入值 值变化时触发
focus event.data.value: string 输入值 输入框获取焦点时触发
blur event.data.value: string 输入值 输入框失去焦点时触发

动作表

当前组件对外暴露以下特性动作,其他组件可以通过指定actionType: 动作名称componentId: 该组件id来触发这些动作,动作配置可以通过args: {动作配置项名称: xxx}来配置具体的参数,详细请查看事件动作

动作名称 动作配置 说明
clear - 清空
reset - 将值重置为resetValue,若没有配置resetValue,则清空
focus - 获取焦点
setValue value: string 更新的值 更新数据