欧美日韩精品一区二区在线线,一级无码在线收看,精品国产高清91,久久精品欧美电影

# input

基礎(chǔ)庫(kù) 1.0.0 開始支持,低版本需做兼容處理

微信 Windows 版:支持

微信 Mac 版:支持

微信 鴻蒙 OS 版:支持

渲染框架支持情況:Skyline (使用最新 Nightly 工具調(diào)試)、WebView

# 功能描述

輸入框。該組件是原生組件,使用時(shí)請(qǐng)注意相關(guān)限制

# 通用屬性

屬性 類型 默認(rèn)值 必填 說明 最低版本
value string 輸入框的初始內(nèi)容 1.0.0
type string text input 的類型 1.0.0
合法值 說明 最低版本
text 文本輸入鍵盤
number 數(shù)字輸入鍵盤
idcard 身份證輸入鍵盤
digit 帶小數(shù)點(diǎn)的數(shù)字鍵盤
safe-password 密碼安全輸入鍵盤 指引。僅 Webview 支持。 2.18.0
nickname 昵稱輸入鍵盤。 2.21.2
password boolean false 是否是密碼類型 1.0.0
placeholder string 輸入框?yàn)榭諘r(shí)占位符 1.0.0
placeholder-style string 指定 placeholder 的樣式 1.0.0
disabled boolean false 是否禁用 1.0.0
maxlength number 140 最大輸入長(zhǎng)度,設(shè)置為 -1 的時(shí)候不限制最大長(zhǎng)度 1.0.0
cursor-spacing number 0 指定光標(biāo)與鍵盤的距離,取 input 距離底部的距離和 cursor-spacing 指定的距離的最小值作為光標(biāo)與鍵盤的距離 1.0.0
auto-focus boolean false (即將廢棄,請(qǐng)直接使用 focus )自動(dòng)聚焦,拉起鍵盤 1.0.0
focus boolean false 獲取焦點(diǎn) 1.0.0
confirm-type string done 設(shè)置鍵盤右下角按鈕的文字,僅在type='text'時(shí)生效 1.1.0
合法值 說明
send 右下角按鈕為“發(fā)送”
search 右下角按鈕為“搜索”
next 右下角按鈕為“下一個(gè)”
go 右下角按鈕為“前往”
done 右下角按鈕為“完成”
always-embed boolean false 強(qiáng)制 input 處于同層狀態(tài),默認(rèn) focus 時(shí) input 會(huì)切到非同層狀態(tài) (僅在 iOS 下生效) 2.10.4
confirm-hold boolean false 點(diǎn)擊鍵盤右下角按鈕時(shí)是否保持鍵盤不收起 1.1.0
cursor number 指定focus時(shí)的光標(biāo)位置 1.5.0
cursor-color string 光標(biāo)顏色。iOS 下的格式為十六進(jìn)制顏色值 #000000,安卓下的只支持 default 和 green,Skyline 下無限制 3.1.0
selection-start number -1 光標(biāo)起始位置,自動(dòng)聚集時(shí)有效,需與selection-end搭配使用 1.9.0
selection-end number -1 光標(biāo)結(jié)束位置,自動(dòng)聚集時(shí)有效,需與selection-start搭配使用 1.9.0
adjust-position boolean true 鍵盤彈起時(shí),是否自動(dòng)上推頁面 1.9.90
hold-keyboard boolean false focus時(shí),點(diǎn)擊頁面的時(shí)候不收起鍵盤 2.8.2
safe-password-cert-path string 安全鍵盤加密公鑰的路徑,只支持包內(nèi)路徑。鴻蒙 OS 暫不支持 2.18.0
safe-password-length number 安全鍵盤輸入密碼長(zhǎng)度。鴻蒙 OS 暫不支持 2.18.0
safe-password-time-stamp number 安全鍵盤加密時(shí)間戳。鴻蒙 OS 暫不支持 2.18.0
safe-password-nonce string 安全鍵盤加密鹽值。鴻蒙 OS 暫不支持 2.18.0
safe-password-salt string 安全鍵盤計(jì)算hash鹽值,若指定custom-hash 則無效。鴻蒙 OS 暫不支持 2.18.0
safe-password-custom-hash string 安全鍵盤計(jì)算hash的算法表達(dá)式,如 md5(sha1('foo' + sha256(sm3(password + 'bar'))))。鴻蒙 OS 暫不支持 2.18.0
bindinput eventhandle 鍵盤輸入時(shí)或內(nèi)容改變時(shí)觸發(fā)。event.detail = { value: string, cursor?: number, keyCode?: number },cursor 為光標(biāo)位置,keyCode 為鍵值。2.1.0 起支持,處理函數(shù)可以直接 return 一個(gè)字符串,將替換輸入框的內(nèi)容。 1.0.0
bindchange eventhandle 鍵盤非聚焦?fàn)顟B(tài)內(nèi)容改變時(shí)觸發(fā)。event.detail = { value: string } 1.0.0
bindfocus eventhandle 輸入框聚焦時(shí)觸發(fā),event.detail = { value: string, height: number },height 為鍵盤高度,在基礎(chǔ)庫(kù) 1.9.90 起支持 1.0.0
bindblur eventhandle 輸入框失去焦點(diǎn)時(shí)觸發(fā),event.detail = { value: string, encryptedValue?: string, encryptError?: string } 1.0.0
bindconfirm eventhandle 點(diǎn)擊完成按鈕時(shí)觸發(fā),event.detail = { value: string, encryptedValue?: string, encryptError?: string } 1.0.0
bindkeyboardheightchange eventhandle 鍵盤高度發(fā)生變化的時(shí)候觸發(fā)此事件,event.detail = {height: number, duration: number} 2.7.0
bindnicknamereview eventhandle 用戶昵稱審核完畢后觸發(fā),僅在 type 為 "nickname" 時(shí)有效,event.detail = { pass: boolean, timeout: boolean } 2.29.1

# Skyline 特有屬性

屬性 類型 默認(rèn)值 必填 說明 最低版本
bind:selectionchange eventhandle 選區(qū)改變事件, {selectionStart, selectionEnd} 3.2.0
bind:keyboardcompositionstart eventhandle 輸入法開始新的輸入時(shí)觸發(fā) (僅當(dāng)輸入法支持時(shí)觸發(fā)) 3.2.0
bind:keyboardcompositionupdate eventhandle 輸入法輸入字符時(shí)觸發(fā)(僅當(dāng)輸入法支持時(shí)觸發(fā)) 3.2.0
bind:keyboardcompositionend eventhandle 輸入法輸入結(jié)束時(shí)觸發(fā)(僅當(dāng)輸入法支持時(shí)觸發(fā)) 3.2.0
worklet:onkeyboardheightchange worklet 鍵盤高度變化時(shí)觸發(fā)。event.detail = {height: height, pageBottomPadding: pageBottomPadding}; height: 鍵盤高度,pageBottomPadding: 頁面上推高度 3.2.4

# WebView 特有屬性

屬性 類型 默認(rèn)值 必填 說明 最低版本
placeholder-class string input-placeholder 指定 placeholder 的樣式類 1.0.0

# Bug & Tip

  1. tip: confirm-type的最終表現(xiàn)與手機(jī)輸入法本身的實(shí)現(xiàn)有關(guān),部分安卓系統(tǒng)輸入法和第三方輸入法可能不支持或不完全支持
  2. tip : input 組件是一個(gè)原生組件,字體是系統(tǒng)字體,所以無法設(shè)置 font-family
  3. tip : 在 input 聚焦期間,避免使用 css 動(dòng)畫
  4. tip : 對(duì)于將 input 封裝在自定義組件中、而 form 在自定義組件外的情況, form 將不能獲得這個(gè)自定義組件中 input 的值。此時(shí)需要使用自定義組件的 內(nèi)置 behaviors wx://form-field
  5. tip : 鍵盤高度發(fā)生變化,keyboardheightchange事件可能會(huì)多次觸發(fā),開發(fā)者對(duì)于相同的height值應(yīng)該忽略掉
  6. bug : 微信版本 6.3.30, focus 屬性設(shè)置無效
  7. bug : 微信版本 6.3.30, placeholder 在聚焦時(shí)出現(xiàn)重影問題

# 示例代碼

在開發(fā)者工具中預(yù)覽效果