当前位置:网站首页>原生小程序 之 input切換 text與password類型
原生小程序 之 input切換 text與password類型
2022-07-07 05:47: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,
})
}
},
边栏推荐
- 基于NCF的多模块协同实例
- Five core elements of architecture design
- ssm框架的简单案例
- R language [logic control] [mathematical operation]
- Web architecture design process
- Codeforces Round #416 (Div. 2) D. Vladik and Favorite Game
- Codeforces Round #416 (Div. 2) D. Vladik and Favorite Game
- 《ClickHouse原理解析与应用实践》读书笔记(6)
- 2pc of distributed transaction solution
- Leakage relay jd1-100
猜你喜欢
I didn't know it until I graduated -- the principle of HowNet duplication check and examples of weight reduction
判断文件是否为DICOM文件
What is dependency injection (DI)
Reading the paper [sensor enlarged egocentric video captioning with dynamic modal attention]
不同网段之间实现GDB远程调试功能
TCC of distributed transaction solutions
K6el-100 leakage relay
ForkJoin最全详解(从原理设计到使用图解)
AI人脸编辑让Lena微笑
SQLSTATE[HY000][1130] Host ‘host. docker. internal‘ is not allowed to connect to this MySQL server
随机推荐
2pc of distributed transaction solution
Introduction to distributed transactions
集群、分布式、微服務的區別和介紹
毕业之后才知道的——知网查重原理以及降重举例
Web Authentication API兼容版本信息
分布式事务介绍
Leetcode: maximum number of "balloons"
【已解决】记一次EasyExcel的报错【读取xls文件时全表读不报错,指定sheet名读取报错】
English grammar_ Noun possessive
sql查询:将下一行减去上一行,并做相应的计算
Digital innovation driven guide
The navigation bar changes colors according to the route
京东商品详情页API接口、京东商品销量API接口、京东商品列表API接口、京东APP详情API接口、京东详情API接口,京东SKU信息接口
JVM the truth you need to know
EMMC打印cqhci: timeout for tag 10提示分析与解决
Get the way to optimize the one-stop worktable of customer service
判断文件是否为DICOM文件
C#可空类型
Jhok-zbl1 leakage relay
上海字节面试问题及薪资福利