|
5 | 5 | <uni-icons v-if="prefixIcon" class="content-clear-icon" :type="prefixIcon" color="#c0c4cc" @click="onClickIcon('prefix')"></uni-icons> |
6 | 6 | <textarea v-if="type === 'textarea'" class="uni-easyinput__content-textarea" :class="{'input-padding':inputBorder}" |
7 | 7 | :name="name" :value="val" :placeholder="placeholder" :placeholderStyle="placeholderStyle" :disabled="disabled" |
8 | | - :maxlength="inputMaxlength" :focus="focused" :autoHeight="autoHeight" @input="onInput" @blur="onBlur" @focus="onFocus" |
| 8 | + :maxlength="inputMaxlength" :focus="focused" :autoHeight="autoHeight" :confirmType="confirmType" @input="onInput" @blur="onBlur" @focus="onFocus" |
9 | 9 | @confirm="onConfirm"></textarea> |
10 | 10 | <input v-else :type="type === 'password'?'text':type" class="uni-easyinput__content-input" :style="{ |
11 | 11 | 'padding-right':type === 'password' ||clearable || prefixIcon?'':'10px', |
12 | 12 | 'padding-left':prefixIcon?'':'10px' |
13 | 13 | }" |
14 | 14 | :name="name" :value="val" :password="!showPassword && type === 'password'" :placeholder="placeholder" |
15 | | - :placeholderStyle="placeholderStyle" :disabled="disabled" :maxlength="inputMaxlength" :focus="focused" @focus="onFocus" |
| 15 | + :placeholderStyle="placeholderStyle" :disabled="disabled" :maxlength="inputMaxlength" :focus="focused" :confirmType="confirmType" @focus="onFocus" |
16 | 16 | @blur="onBlur" @input="onInput" @confirm="onConfirm" /> |
17 | | - <template v-if="type === 'password'"> |
| 17 | + <template v-if="type === 'password' && passwrodIcon" > |
18 | 18 | <uni-icons v-if="val != '' " class="content-clear-icon" :class="{'is-textarea-icon':type==='textarea'}" :type="showPassword?'eye-slash-filled':'eye-filled'" |
19 | 19 | :size="18" color="#c0c4cc" @click="onEyes"></uni-icons> |
20 | 20 | </template> |
|
23 | 23 | </template> |
24 | 24 | <template v-else> |
25 | 25 | <uni-icons class="content-clear-icon" :class="{'is-textarea-icon':type==='textarea'}" type="clear" :size="clearSize" |
26 | | - v-if="clearable && val " color="#c0c4cc" @click="onClear"></uni-icons> |
| 26 | + v-if="clearable && val && !disabled" color="#c0c4cc" @click="onClear"></uni-icons> |
27 | 27 | </template> |
28 | 28 | <slot name="right"></slot> |
29 | 29 | </view> |
|
47 | 47 | * @value number 数字输入键盘,注意iOS上app-vue弹出的数字键盘并非9宫格方式 |
48 | 48 | * @value idcard 身份证输入键盘,信、支付宝、百度、QQ小程序 |
49 | 49 | * @value digit 带小数点的数字键盘 ,App的nvue页面、微信、支付宝、百度、头条、QQ小程序支持 |
50 | | - * @property {Boolean} clearable 是否显示右侧清空内容的图标控件(输入框有内容,且获得焦点时才显示),点击可清空输入框内容(默认true) |
| 50 | + * @property {Boolean} clearable 是否显示右侧清空内容的图标控件,点击可清空输入框内容(默认true) |
51 | 51 | * @property {Boolean} autoHeight 是否自动增高输入区域,type为textarea时有效(默认true) |
52 | 52 | * @property {String } placeholder 输入框的提示文字 |
53 | 53 | * @property {String } placeholderStyle placeholder的样式(内联样式,字符串),如"color: #ddd" |
54 | 54 | * @property {Boolean} focus 是否自动获得焦点(默认false) |
55 | | - * @property {Boolean} disabled 是否不可输入(默认false) |
| 55 | + * @property {Boolean} disabled 是否禁用(默认false) |
56 | 56 | * @property {Number } maxlength 最大输入长度,设置为 -1 的时候不限制最大长度(默认140) |
57 | 57 | * @property {String } confirmType 设置键盘右下角按钮的文字,仅在type="text"时生效(默认done) |
58 | 58 | * @property {Number } clearSize 清除图标的大小,单位px(默认15) |
|
67 | 67 | * @value all 去除全部空格 |
68 | 68 | * @value none 不去除空格 |
69 | 69 | * @property {Boolean} inputBorder 是否显示input输入框的边框(默认true) |
| 70 | + * @property {Boolean} passwrodIcon type=password时是否显示小眼睛图标 |
70 | 71 | * @property {Object} styles 自定义颜色 |
71 | 72 | * @event {Function} input 输入框内容发生变化时触发 |
72 | 73 | * @event {Function} focus 输入框获得焦点时触发 |
|
111 | 112 | type: String, |
112 | 113 | default: 'done' |
113 | 114 | }, |
114 | | - // 清除按钮的大小 |
115 | 115 | clearSize: { |
116 | 116 | type: [Number, String], |
117 | 117 | default: 15 |
118 | 118 | }, |
119 | | - // 是否显示 input 边框 |
120 | 119 | inputBorder: { |
121 | 120 | type: Boolean, |
122 | 121 | default: true |
|
129 | 128 | type: String, |
130 | 129 | default: '' |
131 | 130 | }, |
132 | | - // 是否自动去除两端的空格 |
133 | 131 | trim: { |
134 | 132 | type: [Boolean, String], |
135 | 133 | default: true |
136 | 134 | }, |
137 | | - // 自定义样式 |
| 135 | + passwrodIcon:{ |
| 136 | + type: Boolean, |
| 137 | + default: true |
| 138 | + }, |
138 | 139 | styles: { |
139 | 140 | type: Object, |
140 | 141 | default () { |
|
0 commit comments