当前位置:网站首页>原生小程序 之 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,
})
}
},
边栏推荐
- Zero sequence aperture of leakage relay jolx-gs62 Φ one hundred
- High voltage leakage relay bld-20
- "Multimodal" concept
- MySQL-CentOS7通过YUM安装MySQL
- 得物客服一站式工作台卡顿优化之路
- 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
- Unity让摄像机一直跟随在玩家后上方
- What is dependency injection (DI)
- Leakage relay jelr-250fg
- 不同网段之间实现GDB远程调试功能
猜你喜欢
随机推荐
Five core elements of architecture design
Message queue: how to handle repeated messages?
make makefile cmake qmake都是什么,有什么区别?
得物客服一站式工作台卡顿优化之路
Introduction to distributed transactions
bat 批示处理详解
1. AVL tree: left-right rotation -bite
什么是依赖注入(DI)
论文阅读【Semantic Tag Augmented XlanV Model for Video Captioning】
SAP webservice 测试出现404 Not found Service cannot be reached
Leetcode: maximum number of "balloons"
JSP setting header information export to excel
Paper reading [MM21 pre training for video understanding challenge:video captioning with pre training techniqu]
4. Object mapping Mapster
Web Authentication API兼容版本信息
Distributed global ID generation scheme
《ClickHouse原理解析与应用实践》读书笔记(6)
[论文阅读] A Multi-branch Hybrid Transformer Network for Corneal Endothelial Cell Segmentation
Simple case of SSM framework
The navigation bar changes colors according to the route