| value | string | | 是 | 输入框的初始内容 | |
| type | string | text | 否 | input 的类型 | |
| 合法值说明最低版本 text 文本输入键盘 number 数字输入键盘 idcard 身份证输入键盘 digit 带小数点的数字键盘 safe-password 密码安全输入键盘指引。仅 Webview 支持。 nickname 昵称输入键盘。 |
| password | boolean | false | 否 | 是否是密码类型 | |
| placeholder | string | | 是 | 输入框为空时占位符 | |
| placeholder-style | string | | 是 | 指定 placeholder 的样式 | |
| disabled | boolean | false | 否 | 是否禁用 | |
| maxlength | number | 140 | 否 | 最大输入长度,设置为 -1 的时候不限制最大长度 | |
| cursor-spacing | number | 0 | 否 | 指定光标与键盘的距离,取 input 距离底部的距离和 cursor-spacing 指定的距离的最小值作为光标与键盘的距离 | |
| auto-focus | boolean | false | 否 | (即将废弃,请直接使用 focus )自动聚焦,拉起键盘 | |
| focus | boolean | false | 否 | 获取焦点 | |
| confirm-type | string | done | 否 | 设置键盘右下角按钮的文字,仅在 type='text'时生效 | |
| 合法值说明 send 右下角按钮为“发送”search 右下角按钮为“搜索”next 右下角按钮为“下一个”go 右下角按钮为“前往”done 右下角按钮为“完成” |
| always-embed | boolean | false | 否 | 强制 input 处于同层状态,默认 focus 时 input 会切到非同层状态 (仅在 iOS 下生效) | |
| confirm-hold | boolean | false | 否 | 点击键盘右下角按钮时是否保持键盘不收起 | |
| cursor | number | | 是 | 指定 focus 时的光标位置 | |
| cursor-color | string | | 是 | 光标颜色。iOS 下的格式为十六进制颜色值 #000000,安卓下的只支持 default 和 green,Skyline 下无限制 | |
| selection-start | number | -1 | 否 | 光标起始位置,自动聚集时有效,需与 selection-end 搭配使用 | |
| selection-end | number | -1 | 否 | 光标结束位置,自动聚集时有效,需与 selection-start 搭配使用 | |
| adjust-position | boolean | true | 否 | 键盘弹起时,是否自动上推页面 | |
| hold-keyboard | boolean | false | 否 | focus 时,点击页面的时候不收起键盘 | |
| safe-password-cert-path | string | | 否 | 安全键盘加密公钥的路径,只支持包内路径。鸿蒙 OS 暂不支持 | |
| safe-password-length | number | | 否 | 安全键盘输入密码长度。鸿蒙 OS 暂不支持 | |
| safe-password-time-stamp | number | | 否 | 安全键盘加密时间戳。鸿蒙 OS 暂不支持 | |
| safe-password-nonce | string | | 否 | 安全键盘加密盐值。鸿蒙 OS 暂不支持 | |
| safe-password-salt | string | | 否 | 安全键盘计算 hash 盐值,若指定 custom-hash 则无效。鸿蒙 OS 暂不支持 | |
| safe-password-custom-hash | string | | 否 | 安全键盘计算 hash 的算法表达式,如 md5(sha1('foo' + sha256(sm3(password + 'bar'))))。鸿蒙 OS 暂不支持 | |
| bindinput | eventhandle | | 是 | 键盘输入时或内容改变时触发。event.detail = { value: string, cursor?: number, keyCode?: number },cursor 为光标位置,keyCode 为键值。2.1.0 起支持,处理函数可以直接 return 一个字符串,将替换输入框的内容。 | |
| bindchange | eventhandle | | 是 | 键盘非聚焦状态内容改变时触发。event.detail = { value: string } | |
| bindfocus | eventhandle | | 是 | 输入框聚焦时触发,event.detail = { value: string, height: number },height 为键盘高度,在基础库 1.9.90 起支持 | |
| bindblur | eventhandle | | 是 | 输入框失去焦点时触发,event.detail = { value: string, encryptedValue?: string, encryptError?: string } | |
| bindconfirm | eventhandle | | 是 | 点击完成按钮时触发,event.detail = { value: string, encryptedValue?: string, encryptError?: string } | |
| bindkeyboardheightchange | eventhandle | | 是 | 键盘高度发生变化的时候触发此事件,event.detail = {height: number, duration: number} | |
| bindnicknamereview | eventhandle | | 是 | 用户昵称审核完毕后触发,仅在 type 为 "nickname" 时有效,event.detail = { pass: boolean, timeout: boolean } | |