Input: update input password (#14480)

* refactor: Refactor Input component

* Update input.vue

* Update input.vue
pull/14488/head
iamkun 2019-02-26 12:09:05 +08:00 committed by hetech
parent 59c5506915
commit 969fdd264b
1 changed files with 4 additions and 11 deletions

View File

@ -52,25 +52,18 @@
class="el-input__suffix"
v-if="$slots.suffix || suffixIcon || showClear || showPassword || validateState && needStatusIcon">
<span class="el-input__suffix-inner">
<template v-if="!showClear">
<template v-if="!showClear || !showPwdVisible">
<slot name="suffix"></slot>
<i class="el-input__icon"
v-if="suffixIcon"
:class="suffixIcon">
</i>
</template>
<i v-else
<i v-if="showClear"
class="el-input__icon el-icon-circle-close el-input__clear"
@click="clear"
></i>
<template v-if="!showVisible">
<slot name="suffix"></slot>
<i class="el-input__icon"
v-if="suffixIcon"
:class="suffixIcon">
</i>
</template>
<i v-else
<i v-if="showPwdVisible"
class="el-input__icon el-icon-view el-input__clear"
@click="handlePasswordVisible"
></i>
@ -224,7 +217,7 @@
this.nativeInputValue &&
(this.focused || this.hovering);
},
showVisible() {
showPwdVisible() {
return this.showPassword &&
!this.inputDisabled &&
!this.readonly &&