多行输入框。
效果展示
示例代码
WXML
<view class="page"> |
JS
Page({ |
WXSS
textarea { |
API
属性 | 类型 | 默认值 | 必填 | 说明 |
---|---|---|---|---|
value | string | 否 | 输入框的初始内容 | |
placeholder | string | 否 | 输入框为空时占位符 | |
placeholder-style | string | 否 | 指定 placeholder 的样式 | |
placeholder-class | string | textarea-placeholder | 否 | 指定 placeholder 的样式类 |
disabled | boolean | false | 否 | 是否禁用 |
maxlength | number | 140 | 否 | 最大输入长度,设置为 -1 的时候不限制最大长度 |
auto-height | boolean | false | 否 | 是否自动增高,设置auto-height时,style.height不生效 |
bindinput | eventhandle | 否 | 键盘输入时触发,event.detail = {value, cursor} | |
bindfocus | eventhandle | 否 | 输入框聚焦时触发,event.detail = {value } | |
bindblur | eventhandle | 否 | 输入框失去焦点时触发,event.detail = {value, cursor} | |
bindlinechange | eventhandle | 否 | 输入框行数变化时调用,event.detail = {lineCount } |
多平台支持
属性 | 平台支持 |
---|---|
value | 支付宝 |
placeholder | 支付宝 |
placeholder-style | 支付宝 |
placeholder-class | 支付宝 |
disabled | 支付宝 |
maxlength | 支付宝 |
auto-height | 支付宝 |
bindinput | 支付宝 |
bindfocus | 支付宝 |
bindblur | 支付宝 |
bindlinechange |