Switch effect of input password box plain text and encryption switch

Posted May 27, 20201 min read

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"));
}