小程序模板網(wǎng)

微信小程序:input輸入框和form表單幾種傳值和取值方式 POST和GET請求方式的hea

發(fā)布時(shí)間:2018-04-21 09:09 所屬欄目:小程序開發(fā)教程

1、傳值:index下標(biāo)傳值、頁面navigator傳值

 

2、取值:form表單取值、input框綁定取值

 

微信小程序輸入框input

屬性名 類型 默認(rèn)值 說明
value String   輸入框的內(nèi)容
type String text input的類型,有效值:text,number,idcard,digit,time,date
password Boolean false 是否是密碼類型
placeholder String   輸入框?yàn)榭諘r(shí)占位符
placeholder-style String   指定placeholder的樣式
placeholder-class String input-placeholder 指定placeholder的樣式類
disabled Boolean false 是否禁用
maxlength Number 140 最大輸入長度,設(shè)置為0的時(shí)候不限制最大長度
auto-focus Boolean false 自動(dòng)聚焦,拉起鍵盤。頁面中只能有一個(gè)input設(shè)置auto-focus屬性
focus Boolean false 使得input獲取焦點(diǎn)
bindchange EventHandle   輸入框失去焦點(diǎn)時(shí),觸發(fā)bindchange事件,event.detail={value:value}
bindinput EventHandle   除了date/time類型外的輸入框,當(dāng)鍵盤輸入時(shí),觸發(fā)input事件,event.detail={value:value},處理函數(shù)可以直接return一個(gè)字符串,將替換輸入框的內(nèi)容。
bindfocus EventHandle   輸入框聚焦時(shí)觸發(fā),event.detail = {value:value}
bindblur EventHandle   輸入框失去焦點(diǎn)時(shí)觸發(fā),event.detail = {value:value}


易優(yōu)小程序(企業(yè)版)+靈活api+前后代碼開源 碼云倉庫:starfork
本文地址:http://www.u-renovate.com/wxmini/doc/course/23833.html 復(fù)制鏈接 如需定制請聯(lián)系易優(yōu)客服咨詢:800182392 點(diǎn)擊咨詢
QQ在線咨詢
AI智能客服 ×