小程序input密文

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_30299243/article/details/84347782

type = "password"表示密文  这是小程序自带的密文方法。也就是在这上面做文章。

<input type="ifshow" placeholder="请输入登录密码"/>

ifshow: "password", //表示密文

//  ifshow: "text",   非密文

/**

*判断的方法

*/

showPassword: function () {

if (this.data.ifshow==“password) { //如果是密文,则改成非密文

this.setData({

show: "text"

})

} else {

this.setData({

show: "password"

})

}

},

猜你喜欢

转载自blog.csdn.net/qq_30299243/article/details/84347782