<a-form-model-item required prop="password">
<a-input
v-model="model.password"
size="large"
:type="password"
placeholder="请输入密码"
>
<i slot="prefix" class="tubiao delumima" :style="{ color: '#C00000' }" />
<i
v-if="delubukejian"
slot="suffix"
class="tubiao delubukejian"
@click="changeType()"
style="color: #969796"
/>
<i v-else slot="suffix" class="tubiao deluxianshikejian" style="color: #969796" @click="changeType()" />
</a-input>
</a-form-model-item>
data下面
delubukejian: true, //眼睛显示隐藏
password: 'password', //input 密码隐藏
methods下面的方法
// 点击时触发眼睛图标显示隐藏功能
changeType() {
if (this.delubukejian) {
this.delubukejian = false
this.password = 'text'
} else {
this.delubukejian = true
this.password = 'password'
}
},