# Textarea 多行文本框
# 介绍
用于输入或编辑多行文本。
# 使用指南
# 基础,定义初始值
<tms-textarea custom-value="初始值"/>
# 自定义样式 自动高度
<tms-textarea custom-style="border:1px solid green;" auto-height/>
# 固定高度
<tms-textarea custom-style="border:1px solid black;height:100px;"/>
# API
大部分API都继承了微信官方input组件,请查看 微信官方文档 (opens new window) 了解更多。
| 属性 | 说明 | 类型 | 默认值 | 版本 |
|---|---|---|---|---|
| custom-value | 输入框内容 | string | '' | |
| custom-style | 自定义样式 | string | '' | |
| placeholder-style | 请查看微信官方文档 | string | '' | |
| confirm-type | 请查看微信官方文档 | string | '' | |
| placeholder | 请查看微信官方文档 | string | '' | |
| type | 请查看微信官方文档 | string | 'text' | |
| text-align | 文本对齐方向 | string | 'left' | |
| confirm-hold | 请查看微信官方文档 | boolean | false | |
| disabled | 请查看微信官方文档 | boolean | false | |
| readonly | 是否只读模式 | boolean | false | |
| auto-focus | 请查看微信官方文档 | boolean | false | |
| focus | 请查看微信官方文档 | boolean | false | |
| clearable | 是否显示清除图标 | boolean | true | |
| invalid | 无效输入模式 | boolean | false | |
| adjust-position | 请查看微信官方文档 | boolean | true | |
| hold-keyboard | 请查看微信官方文档 | boolean | false | |
| auto-height | 请查看微信官方文档 | boolean | false | |
| show-confirm-bar | 请查看微信官方文档 | boolean | true | |
| maxlength | 请查看微信官方文档 | number | -1 | |
| cursor | 请查看微信官方文档 | number | -1 | |
| selection-start | 请查看微信官方文档 | number | -1 | |
| selection-end | 请查看微信官方文档 | number | -1 | |
| cursor-spacing | 请查看微信官方文档 | number | 50 |
# EVENTS
| 属性 | 说明 | 类型 |
|---|---|---|
| bind:clear-input | 点击清除按钮事件 | (event) => {} |
| bind:content-change | 输入框内容变化时调用 | (event) => {} |
| bind:click | 点击输入框内容区域事件 | (event) => {} |
| bind:blur | 请查看微信官方文档 | (event) => {} |
| bind:focus | 请查看微信官方文档 | (event) => {} |
| bind:confirm | 请查看微信官方文档 | (event) => {} |
| bind:keyboardheightchange | 请查看微信官方文档 | (event) => {} |
# CSS变量
// 文本颜色
--textarea-text-color: #333333;
// 文本line-height
--textarea-text-line-height: 1.2;
// 禁用状态文本颜色
--textarea-disabled-text-color: rgb(200, 201, 204);
// 占位符文本颜色
--textarea-placeholder-text-color: #BFC0C3;
// 清除图标大小
--textarea-clear-icon-size: 30rpx;
// 文本区域最小高度
--textarea-content-min-height: 36rpx;
# FAQ
请查看微信官方文档
