当前位置:网站首页>原生小程序 之 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,
})
}
},
边栏推荐
- zabbix_get测试数据库失败
- make makefile cmake qmake都是什么,有什么区别?
- 纪念下,我从CSDN搬家到博客园啦!
- Educational Codeforces Round 22 B. The Golden Age
- 淘寶商品詳情頁API接口、淘寶商品列錶API接口,淘寶商品銷量API接口,淘寶APP詳情API接口,淘寶詳情API接口
- Hcip seventh operation
- Dynamic memory management
- [JS component] date display.
- 基于NCF的多模块协同实例
- The navigation bar changes colors according to the route
猜你喜欢
Paper reading [semantic tag enlarged xlnv model for video captioning]
sql查询:将下一行减去上一行,并做相应的计算
English grammar_ Noun possessive
JVM the truth you need to know
集群、分布式、微服务的区别和介绍
What is dependency injection (DI)
Digital innovation driven guide
常用消息队列有哪些?
论文阅读【Semantic Tag Augmented XlanV Model for Video Captioning】
Common skills and understanding of SQL optimization
随机推荐
Simple case of SSM framework
毕业之后才知道的——知网查重原理以及降重举例
Dynamic memory management
5. Data access - entityframework integration
集群、分布式、微服務的區別和介紹
SAP webservice 测试出现404 Not found Service cannot be reached
R语言【逻辑控制】【数学运算】
DOM node object + time node comprehensive case
判断文件是否为DICOM文件
论文阅读【Open-book Video Captioning with Retrieve-Copy-Generate Network】
SQL query: subtract the previous row from the next row and make corresponding calculations
[论文阅读] 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
5. 数据访问 - EntityFramework集成
Five core elements of architecture design
什么是依赖注入(DI)
爬虫练习题(三)
Codeforces Round #416 (Div. 2) D. Vladik and Favorite Game
Jhok-zbg2 leakage relay