<div class="form_item">
<span class="item_name indent">登陆密码</span>
<input type="text" v-model="dataList.password"/>
<span class="btn" @click="showPassWord" v-if="passwordFlag">隐藏</span>
<span class="btn" @click="hidePassWord" v-else>显示</span>
</div>
// 隐藏密码
hidePassWord(){
this.passwordshow = this.dataList.password
if(this.dataList.password){
this.dataList.password = this.dataList.password.replace(/./g,*)
this.passwordFlag = false
}
},
// 显示密码
showPassWord(){
if(this.dataList.password){
this.dataList.password = this.passwordshow
this.passwordFlag = true
}
},
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/tech/pnotes/290322.html