fix input password type

pull/402/head
baiyaaaaa 2016-10-13 17:36:01 +08:00 committed by cinwell.li
parent 4f3dcd825e
commit 96ff5e1dc7
1 changed files with 23 additions and 2 deletions

View File

@ -13,6 +13,7 @@
<slot name="prepend"></slot>
</div>
<input
v-if="type === 'text'"
class="el-input__inner"
v-model="currentValue"
type="text"
@ -25,7 +26,24 @@
:minlength="minlength"
:autocomplete="autoComplete"
ref="input"
@focus="$emit('focus', currentValue)"
@focus="handleFocus"
@blur="handleBlur"
>
<input
v-if="type === 'password'"
class="el-input__inner"
v-model="currentValue"
type="password"
:name="name"
:placeholder="placeholder"
:disabled="disabled"
:readonly="readonly"
:number="number"
:maxlength="maxlength"
:minlength="minlength"
:autocomplete="autoComplete"
ref="input"
@focus="handleFocus"
@blur="handleBlur"
>
<!-- input 图标 -->
@ -49,7 +67,7 @@
:rows="rows"
:maxlength="maxlength"
:minlength="minlength"
@focus="$emit('focus', currentValue)"
@focus="handleFocus"
@blur="handleBlur">
</textarea>
</div>
@ -130,6 +148,9 @@
const minRows = autosize ? autosize.minRows : null;
const maxRows = autosize ? autosize.maxRows : null;
this.textareaStyle = calcTextareaHeight(this.$refs.textarea, minRows, maxRows);
},
handleFocus(ev) {
this.$emit('focus', ev);
}
},