html5 密码框明文,elementUI的密码框的密文和明文
生活随笔
收集整理的這篇文章主要介紹了
html5 密码框明文,elementUI的密码框的密文和明文
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
基于elementui 框架的登錄時密碼框的明文和密文
登錄
1、template
v-model.trim="ruleForm.password"
placeholder="請輸入密碼"
:type="passw"
clearable
@blur="onBlur"
>
2、script
data(){
return{
icon: "el-input__icon el-icon-view",
passw: "password",
}
},
methods:{
//密碼的隱藏和顯示
showPass() {
//點擊圖標是密碼隱藏或顯示
if (this.passw == "text") {
this.passw = "password";
//更換圖標
this.icon = "el-input__icon el-icon-view";
} else {
this.passw = "text";
this.icon = "el-input__icon el-icon-loading";
setTimeout(()=>{
this.icon = "";
},500)
}
},
//密碼失焦事件
onBlur(){
this.passw = "password";
this.icon = "el-input__icon el-icon-view";
},
}
總結
以上是生活随笔為你收集整理的html5 密码框明文,elementUI的密码框的密文和明文的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: java 圆 继承_java 类的继承(
- 下一篇: 定时执行java程序_如何让Java程序