textarea(多行输入框)又称文本域,也是开发中常用的组件,在评论、简介等场景下应用
在textarea中可以输入多行内容
textarea组件的属性
index.wxml
-------------------
<view>
<textarea
bindblur="bindTextAreaBlur"
auto-height
placeholder="自动变高"
placeholder-style="font-size:24px;color:#ccc;"
maxlength="140"
auto-focus
show-confirm-bar
bindlinechange="onChange"
bindinput="onInput"
bindconfirm="onConfirm"
/>
</view>
=====================================================================
index.js
------------------------
Page({
data: {
height: 20,
focus: false
},
onChange: function(e){
console.log('textarea change:',e.detail.value)
},
onInput: function(e){
console.log('textarea input:', e.detail.value)
},
onConfirm: function(e){
console.log('textarea confirm:', e.detail.value)
}
})