欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

微信小程序 textarea 組件詳解及簡(jiǎn)單實(shí)例

 更新時(shí)間:2017年01月10日 15:08:48   投稿:lqh  
這篇文章主要介紹了微信小程序 textarea 組件詳解及簡(jiǎn)單實(shí)例的相關(guān)資料,需要的朋友可以參考下

微信小程序textarea

相關(guān)文章:

微信小程序 Button

微信小程序 radio

微信小程序 slider

微信小程序 switch

微信小程序 textarea

微信小程序 picker-view

微信小程序 picker

微信小程序 label

微信小程序 input 

微信小程序 form

微信小程序 checkbox

多行輸入框。

屬性名 類型 默認(rèn)值 說(shuō)明
value String   輸入框的內(nèi)容
placeholder String   輸入框?yàn)榭諘r(shí)占位符
placeholder-style String   指定 placeholder 的樣式
placeholder-class String textarea-placeholder 指定 placeholder 的樣式類
disabled Boolean false 是否禁用
maxlength Number 140 最大輸入長(zhǎng)度,設(shè)置為0的時(shí)候不限制最大長(zhǎng)度
auto-focus Boolean false 自動(dòng)聚焦,拉起鍵盤(pán)。頁(yè)面中只能有一個(gè) <textarea/> 或<input/> 設(shè)置 auto-focus 屬性
focus Boolean false 獲取焦點(diǎn)(開(kāi)發(fā)工具暫不支持)
auto-height Boolean false 是否自動(dòng)增高,設(shè)置auto-height時(shí),style.height不生效
bindfocus EventHandle   輸入框聚焦時(shí)觸發(fā),event.detail = {value: value}
bindblur EventHandle   輸入框失去焦點(diǎn)時(shí)觸發(fā),event.detail = {value: value}
bindlinechange EventHandle   輸入框行數(shù)變化時(shí)調(diào)用,event.detail = {height: 0, heightRpx: 0, lineCount: 0}

示例代碼:

<!--textarea.wxml-->
<view class="section">
 <textarea bindblur="bindTextAreaBlur" auto-height placeholder="自動(dòng)變高" />
</view>
<view class="section">
 <textarea placeholder="placeholder顏色是紅色的" placeholder-style="color:red;" />
</view>
<view class="section">
 <textarea placeholder="這是一個(gè)可以自動(dòng)聚焦的textarea" auto-focus />
</view>
<view class="section">
 <textarea placeholder="這個(gè)只有在按鈕點(diǎn)擊的時(shí)候才聚焦" focus="{{focus}}" />
 <view class="btn-area">
 <button bindtap="bindButtonTap">使得輸入框獲取焦點(diǎn)</button>
 </view>
</view>
//textarea.js
Page({
 data: {
 height: 20,
 focus: false
 },
 bindButtonTap: function() {
 this.setData({
 focus: true
 })
 },
 bindTextAreaBlur: function(e) {
 console.log(e.detail.value)
 }
})

Bug & Tipbug: 微信版本 6.3.30,textarea 在列表渲染時(shí),新增加的 textarea 在自動(dòng)聚焦時(shí)的位置計(jì)算錯(cuò)誤tip: 請(qǐng)勿在 scroll-view 中使用 textarea 組件

感謝閱讀,希望能幫助到大家,謝謝大家對(duì)本站的支持!

相關(guān)文章

最新評(píng)論