本文主要是介绍微信小程序、uniapp密码小眼睛,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
直接上代码喔喔喔喔喔喔喔喔~~
<input name="username" password="{{passwordHideShow}}" placeholder-style="color:#bdbdbd" type="text"maxlength="20" value="{{passwordNumber}}" bindinput="passwordInput" /><view class="icon " catchtap="passwordClick" data-type="pas"><image src="{{passwordHideShow?'../../images/look.png':'../../images/noLook.png'}}"></image> </view>
data: {passwordHideShow: true, //小眼睛passwordNumber: '', //密码// 重复passwordHideShow1: true, //小眼睛passwordNumber1: '', //密码},showPwdChange: function() {this.setData({passwordHideShow: !this.data.passwordHideShow})},passwordClick(e) {console.log(this.data.passwordNumber)if(e.currentTarget.dataset.type=='pas'){// 密码this.setData({passwordHideShow: this.data.passwordHideShow ? false : true})return }// 重复密码this.setData({passwordHideShow1: this.data.passwordHideShow1 ? false : true})},passwordInput(e) {this.setData({passwordNumber: e.detail.value})},passwordInput1(e) {this.setData({passwordNumber1: e.detail.value})},
完事啦啦啦啦啦啦啦啦~~~~~~~~~~~
这篇关于微信小程序、uniapp密码小眼睛的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!