input 动态改变password属性:true/false
< input class = "input" placeholder-class = "placeholder" placeholder = "请输入密码" password = "{{isAbleSee ? false : true}}" bindinput = "passwordInput" /> |
< image src = "{{isAbleSee ? '../../images/enable_see.png' : '../../images/unable_see.png'}}" class = "icAvatar" bindtap = "seeCheck" > |
通过点击眼睛图标来显示/隐藏密码。js很简单,如下所示:
seeCheck: function (e) { this .setData({ isAbleSee: ! this .data.isAbleSee }) } |
上述代码在开发工具上能达到预期效果,在android手机上无效。