input密码框明文和加密切换的开关效果

45次阅读

共计 277 个字符,预计需要花费 1 分钟才能阅读完成。

let imageUrl = require("@/assets/images/icon_off.png");
let isShow = false;
let pwdType = "password";
show() {
    isShow ? 
    ((imageUrl =    require("@/assets/images/icon_off.png")), (isShow = false), (pwdType = "password")) 
    : 
    ((imageUrl = require("@/assets/images/icon_on.png")), (isShow = true), (pwdType = "text"));
}

正文完
 0