当前位置:网站首页>原生小程序 之 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,
})
}
},
边栏推荐
- Bat instruction processing details
- OpenSergo 即将发布 v1alpha1,丰富全链路异构架构的服务治理能力
- 4. Object mapping Mapster
- 三级菜单数据实现,实现嵌套三级菜单数据
- Distributed global ID generation scheme
- Educational Codeforces Round 22 B. The Golden Age
- 架构设计的五个核心要素
- 微信小程序蓝牙连接硬件设备并进行通讯,小程序蓝牙因距离异常断开自动重连,js实现crc校验位
- 集群、分布式、微服務的區別和介紹
- Simple case of SSM framework
猜你喜欢

WEB架构设计过程

《2022中国低/无代码市场研究及选型评估报告》发布

Leetcode: maximum number of "balloons"

什么是消息队列?

What is dependency injection (DI)

Dj-zbs2 leakage relay

AI人脸编辑让Lena微笑
![[论文阅读] Semi-supervised Left Atrium Segmentation with Mutual Consistency Training](/img/d6/e6db0d76e81e49a83a30f8c1832f09.png)
[论文阅读] Semi-supervised Left Atrium Segmentation with Mutual Consistency Training
![[论文阅读] A Multi-branch Hybrid Transformer Network for Corneal Endothelial Cell Segmentation](/img/f6/cd307c03ea723e1fb6a0011b37d3ef.png)
[论文阅读] A Multi-branch Hybrid Transformer Network for Corneal Endothelial Cell Segmentation

不同网段之间实现GDB远程调试功能
随机推荐
爬虫练习题(三)
async / await
什么是消息队列?
Go language context explanation
Web architecture design process
消息队列:重复消息如何处理?
集群、分布式、微服务的区别和介绍
Taobao store release API interface (New), Taobao oauth2.0 store commodity API interface, Taobao commodity release API interface, Taobao commodity launch API interface, a complete set of launch store i
Leetcode 1189 maximum number of "balloons" [map] the leetcode road of heroding
力扣102题:二叉树的层序遍历
Determine whether the file is a DICOM file
SAP webservice 测试出现404 Not found Service cannot be reached
什么是依赖注入(DI)
What are the common message queues?
[论文阅读] A Multi-branch Hybrid Transformer Network for Corneal Endothelial Cell Segmentation
JD commodity details page API interface, JD commodity sales API interface, JD commodity list API interface, JD app details API interface, JD details API interface, JD SKU information interface
分布式全局ID生成方案
I didn't know it until I graduated -- the principle of HowNet duplication check and examples of weight reduction
判断文件是否为DICOM文件
Three level menu data implementation, nested three-level menu data