一. 属性说明
代码Github地址
一.input属性说明
属性名 | 类型 | 默认值 | 说明 |
---|---|---|---|
value | String | 输入框的内容 | |
placeholder | String | 输入框为空时占位符 | |
placeholder-class | String | input-placeholder | 指定 placeholder 的样式类 |
password | Boolean | false | 是否是密码类型 |
disabled | Boolean | false | 是否禁用 |
maxlength | Number | 140 | 最大输入长度,设置为 -1 的时候不限制最大长度 |
focus | Boolean | false | 获取焦点(使之成为第一响应者) |
cursor | Number | 指定focus时的光标位置.如果文本的长度不满足,则光标在文本最后。 | |
adjust-position | Boolean | true | 键盘弹起时,是否自动上推页面 |
cursor-spacing | Number | 0 | 指定光标与键盘的距离,单位 px 。 |
type | String | text | input 弹出键盘的类型(文本(text),数字(number),身份证(idcard),带小数点的数字(digit)) |
confirm-type | String | done | 设置键盘右下角按钮的文字。(send,search,next,go,done) |
confirm-hold | Boolean | false | 点击键盘右下角按钮时是否保持键盘不收起 |
bindconfirm | EventHandle | 点击完成按钮时触发,event.detail = {value: value} | |
bindfocus | EventHandle | 输入框聚焦时触发,event.detail = { value, height },height 为键盘高度 | |
bindblur | EventHandle | 输入框失去焦点时触发,event.detail = {value: value} | |
bindinput | EventHandle | 键盘输入时触发,event.detail = {value, cursor, keyCode},keyCode 为键值 |
网友评论