国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

首頁 微信小程式 小程式開發(fā) 微信小程式元件:textarea多行輸入框解讀與分析

微信小程式元件:textarea多行輸入框解讀與分析

May 22, 2018 am 11:55 AM

textarea多行輸入框元件說明:

textarea 多行輸入框。

textarea多行輸入框範例程式碼運作效果如下: ? ?

 微信小程序組件:textarea多行輸入框解讀和分析

#下面是WXML程式碼:

<view class="content">
placeholder:
<textarea placeholder="占位符" />
<textarea placeholder="占位符 改變樣式style" placeholder-style=
"color:blue"/>
<textarea placeholder="占位符 改變樣式class" placeholder-class="placeholdText"/>
</view>

下面是WXSS程式碼:

.content{
??border:1px?black?solid;
??margin:?10px;
??font-size:?10pt;
??padding:?10px;
}
textarea{
??border:?1px?red?solid;
??margin:?auto;
??width:100%;
??height:?3em;
??margin-top:5px;
??padding:?3px;
}
/*占位符樣式*/
.placeholdText{
??font-size:?2em;
}

textarea多行輸入框的事件效果圖:

 微信小程序組件:textarea多行輸入框解讀和分析

#下面是WXML程式碼::

<view class="content">
auto-height:
<textarea  auto-height placeholder="自動增高,style.height不生效"/>
bindinput="當內容改變"
<textarea  placeholder="" bindlinechange="bindlinechange"/>
bindfocus:當獲取焦點
<textarea  placeholder="當獲取焦點" value="" bindfocus="bindfocus"/>
bindblur:當失去焦點觸發(fā)
<textarea  placeholder="當失去焦點" bindblur="bindblur"/>
</view>
事件觸發(fā):
<view class="content"  style="color:blue">
{{log}}
</view>

下面是JS程式碼::

Page({
??data:{
????log:'事件觸發(fā)'
??},
??//行高改變時
??bindlinechange:function(e){
????var?height=e.detail.height;
????var?heightRpx=e.detail.heightRpx;
????var?lineCount=e.detail.lineCount;
????this.setData({
??????log:"height="+height+"??|??heightRpx="+heightRpx+"??|??lineCount="+lineCount
????})
??},
????//文本失去焦點
??bindblur:function(e){
????var?value=e.detail.value;
?????this.setData({
??????log:"bindblur失去改變.獲取textarea值="+value
????})
??},
???//文本獲取焦點
??bindfocus:function(e){
????var?value=e.detail.value;
?????this.setData({
??????log:"bindfocus獲取焦點,獲取textarea值="+value
????})
??}
})

以下是WXSS程式碼::

.content{
??border:1px?black?solid;
??margin:?10px;
??font-size:?10pt;
??padding:?10px;
}
textarea{
??border:?1px?red?solid;
??margin:?auto;
??width:100%;
??height:?3em;
??margin-top:5px;
??padding:?3px;
}

 微信小程序組件:textarea多行輸入框解讀和分析

#屬性解析:

下面是WXML程式碼:

<!--=======屬性=======-->
<!--value:輸入框內容-->
<textarea value="內容"/>
<!--placeholder:占位符,對輸入框內容提示-->
<textarea placeholder="占位符" placeholder-class="占位符靜態(tài)樣式"   placeholder-style="占位符動態(tài)樣式"/>
<!--disabled:控制標簽有效,或者失效狀態(tài),在失效狀態(tài),不能獲取該值-->
<textarea disabled="true"/>
<textarea disabled/>?等同于?<textarea disabled="false"/>
<!--maxlength:內容長度限制,默認140-->
<textarea  maxlength="100"/>
<textarea  maxlength/>?等同于?<textarea  maxlength="140"/>
<!--focus:初始化時,獲取輸入焦點(目前開發(fā)工具暫不支持)-->
<textarea  focus="true"/>
<textarea focus/>?等同于?<textarea focus="false"/>
<!--auto-focus:當界面只有一個textarea,自動獲取焦點-->
<textarea   auto-focus="true"/>
<textarea   auto-focus/>?等同于?<textarea auto-focus="false"/>
<!--auto-height:是否自動增高,設置auto-height時,style.height不生效-->
<textarea  auto-height="true"/>
<textarea  auto-height/>?等同于?<textarea auto-height="false"/>
<!--=======事件=======-->
<!--bindlinechange:輸入框行數變化時調用 返回參數:height,heightRpx,lineCount-->
<textarea bindlinechange="自己定義函數名"/>
<!--bindfocus:當獲取焦點,可用輸入狀態(tài)時觸發(fā)-->
<textarea bindfocus="自己定義函數名"/>
<!--bindblur:當失去焦點觸發(fā)-->

以上是微信小程式元件:textarea多行輸入框解讀與分析的詳細內容。更多資訊請關注PHP中文網其他相關文章!

本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發(fā)現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn

熱AI工具

Undress AI Tool

Undress AI Tool

免費脫衣圖片

Undresser.AI Undress

Undresser.AI Undress

人工智慧驅動的應用程序,用於創(chuàng)建逼真的裸體照片

AI Clothes Remover

AI Clothes Remover

用於從照片中去除衣服的線上人工智慧工具。

Clothoff.io

Clothoff.io

AI脫衣器

Video Face Swap

Video Face Swap

使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱工具

記事本++7.3.1

記事本++7.3.1

好用且免費的程式碼編輯器

SublimeText3漢化版

SublimeText3漢化版

中文版,非常好用

禪工作室 13.0.1

禪工作室 13.0.1

強大的PHP整合開發(fā)環(huán)境

Dreamweaver CS6

Dreamweaver CS6

視覺化網頁開發(fā)工具

SublimeText3 Mac版

SublimeText3 Mac版

神級程式碼編輯軟體(SublimeText3)