|
|
@@ -9,7 +9,7 @@
|
|
|
<textarea :enableNative="enableNative" v-if="type === 'textarea'" class="uni-easyinput__content-textarea"
|
|
|
:class="{ 'input-padding': inputBorder }" :name="name" :value="val" :placeholder="placeholder"
|
|
|
:placeholderStyle="placeholderStyle" :disabled="disabled"
|
|
|
- placeholder-class="uni-easyinput__placeholder-class" :maxlength="inputMaxlength" :focus="focused"
|
|
|
+ placeholder-class="uni-easyinput__placeholder-class" :minlength="inputMinlength" :maxlength="inputMaxlength" :focus="focused"
|
|
|
:autoHeight="autoHeight" :cursor-spacing="cursorSpacing" :adjust-position="adjustPosition"
|
|
|
@input="onInput" @blur="_Blur" @focus="_Focus" @confirm="onConfirm"
|
|
|
@keyboardheightchange="onkeyboardheightchange" @wheel.prevent></textarea>
|
|
|
@@ -17,7 +17,7 @@
|
|
|
class="uni-easyinput__content-input" :style="inputStyle" :name="name" :value="val"
|
|
|
:password="!showPassword && type === 'password'" :placeholder="placeholder"
|
|
|
:placeholderStyle="placeholderStyle" placeholder-class="uni-easyinput__placeholder-class"
|
|
|
- :disabled="disabled" :maxlength="inputMaxlength" :focus="focused" :confirmType="confirmType"
|
|
|
+ :disabled="disabled" :minlength="inputMinlength" :maxlength="inputMaxlength" :focus="focused" :confirmType="confirmType"
|
|
|
:cursor-spacing="cursorSpacing" :adjust-position="adjustPosition" @focus="_Focus" @blur="_Blur"
|
|
|
@input="onInput" @confirm="onConfirm" @keyboardheightchange="onkeyboardheightchange" @wheel.prevent />
|
|
|
<!-- #endif -->
|
|
|
@@ -25,14 +25,14 @@
|
|
|
<textarea v-if="type === 'textarea'" class="uni-easyinput__content-textarea"
|
|
|
:class="{ 'input-padding': inputBorder }" :name="name" :value="val" :placeholder="placeholder"
|
|
|
:placeholderStyle="placeholderStyle" :disabled="disabled"
|
|
|
- placeholder-class="uni-easyinput__placeholder-class" :maxlength="inputMaxlength" :focus="focused"
|
|
|
+ placeholder-class="uni-easyinput__placeholder-class" :minlength="inputMinlength" :maxlength="inputMaxlength" :focus="focused"
|
|
|
:autoHeight="autoHeight" :cursor-spacing="cursorSpacing" :adjust-position="adjustPosition"
|
|
|
@input="onInput" @blur="_Blur" @focus="_Focus" @confirm="onConfirm"
|
|
|
@keyboardheightchange="onkeyboardheightchange" @wheel.prevent></textarea>
|
|
|
<input v-else :type="type === 'password' ? 'text' : type" class="uni-easyinput__content-input"
|
|
|
:style="inputStyle" :name="name" :value="val" :password="!showPassword && type === 'password'"
|
|
|
:placeholder="placeholder" :placeholderStyle="placeholderStyle"
|
|
|
- placeholder-class="uni-easyinput__placeholder-class" :disabled="disabled" :maxlength="inputMaxlength"
|
|
|
+ placeholder-class="uni-easyinput__placeholder-class" :disabled="disabled" :minlength="inputMinlength" :maxlength="inputMaxlength"
|
|
|
:focus="focused" :confirmType="confirmType" :cursor-spacing="cursorSpacing"
|
|
|
:adjust-position="adjustPosition" @focus="_Focus" @blur="_Blur" @input="onInput" @confirm="onConfirm"
|
|
|
@keyboardheightchange="onkeyboardheightchange" @wheel.prevent />
|
|
|
@@ -78,6 +78,7 @@
|
|
|
* @property {Boolean} focus 是否自动获得焦点(默认false)
|
|
|
* @property {Boolean} disabled 是否禁用(默认false)
|
|
|
* @property {Number } maxlength 最大输入长度,设置为 -1 的时候不限制最大长度(默认140)
|
|
|
+ * @property {Number } minlength 最小输入长度(默认0)
|
|
|
* @property {String } confirmType 设置键盘右下角按钮的文字,仅在type="text"时生效(默认done)
|
|
|
* @property {Number } clearSize 清除图标的大小,单位px(默认15)
|
|
|
* @property {String} prefixIcon 输入框头部图标
|
|
|
@@ -192,6 +193,10 @@ export default {
|
|
|
type: [Number, String],
|
|
|
default: 140
|
|
|
},
|
|
|
+ minlength: {
|
|
|
+ type: [Number, String],
|
|
|
+ default: 0
|
|
|
+ },
|
|
|
confirmType: {
|
|
|
type: String,
|
|
|
default: 'done'
|
|
|
@@ -287,10 +292,12 @@ export default {
|
|
|
// TODO 处理头条 formItem 中 errMsg 不更新的问题
|
|
|
return this.localMsg || this.errorMessage;
|
|
|
},
|
|
|
- // 因为uniapp的input组件的maxlength组件必须要数值,这里转为数值,用户可以传入字符串数值
|
|
|
inputMaxlength() {
|
|
|
return Number(this.maxlength);
|
|
|
},
|
|
|
+ inputMinlength() {
|
|
|
+ return Number(this.minlength);
|
|
|
+ },
|
|
|
|
|
|
// 处理外层样式的style
|
|
|
boxStyle() {
|