当前位置:网站首页>原生小程序 之 input切换 text与password类型
原生小程序 之 input切换 text与password类型
2022-07-07 00:08:00 【不求人0】
原生小程序 之 input切换 text与password类型
login.wxml
<input type="text" password="{
{ !isShowPwd }}" placeholder="请输入密码" value='{
{password}}' maxlength="11" class="phonePassword" placeholder-class="placeholderClass"></input>
<image class='input-img input-img2' bindtap='changePwdType' src="{
{isShowPwd ? '/static/login/viewPassword.png' : '/static/login/hidePassword.png'}}"></image>
login.js
data: {
isShowPwd:true, // 是否显示密码
phoneNum: '',
password: '',
},
// 切换密码格式
changePwdType(){
if (this.data.isShowPwd) {
//如果this.data.isShow为true,则表示为密码小黑点
this.setData({
isShowPwd:false,
})
} else {
this.setData({
isShowPwd: true,
})
}
},
边栏推荐
- 微信小程序蓝牙连接硬件设备并进行通讯,小程序蓝牙因距离异常断开自动重连,js实现crc校验位
- App clear data source code tracking
- Message queuing: how to ensure that messages are not lost
- Flink SQL realizes reading and writing redis and dynamically generates hset key
- 架构设计的五个核心要素
- SQL query: subtract the previous row from the next row and make corresponding calculations
- CVE-2021-3156 漏洞复现笔记
- 消息队列:消息积压如何处理?
- Pytorch builds neural network to predict temperature
- Leakage relay llj-100fs
猜你喜欢
随机推荐
2pc of distributed transaction solution
消息队列:重复消息如何处理?
Leetcode: maximum number of "balloons"
[reading of the paper] a multi branch hybrid transformer network for channel terminal cell segmentation
win配置pm2开机自启node项目
Polynomial locus of order 5
Hcip seventh operation
Nodejs get client IP
Leetcode 1189 maximum number of "balloons" [map] the leetcode road of heroding
《ClickHouse原理解析与应用实践》读书笔记(6)
常用消息队列有哪些?
Aidl and service
淘宝商品详情页API接口、淘宝商品列表API接口,淘宝商品销量API接口,淘宝APP详情API接口,淘宝详情API接口
Go 语言的 Context 详解
How to get free traffic in pinduoduo new store and what links need to be optimized in order to effectively improve the free traffic in the store
DOM node object + time node comprehensive case
C#可空类型
zabbix_get测试数据库失败
Codeforces Round #416 (Div. 2) D. Vladik and Favorite Game
Unity keeps the camera behind and above the player