当前位置:网站首页>原生小程序 之 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,
})
}
},
边栏推荐
猜你喜欢
Web Authentication API兼容版本信息
[论文阅读] A Multi-branch Hybrid Transformer Network for Corneal Endothelial Cell Segmentation
消息队列:消息积压如何处理?
R language [logic control] [mathematical operation]
论文阅读【MM21 Pre-training for Video Understanding Challenge:Video Captioning with Pretraining Techniqu】
Leakage relay jelr-250fg
I didn't know it until I graduated -- the principle of HowNet duplication check and examples of weight reduction
EMMC打印cqhci: timeout for tag 10提示分析与解决
Getting started with DES encryption
R语言【逻辑控制】【数学运算】
随机推荐
微信小程序蓝牙连接硬件设备并进行通讯,小程序蓝牙因距离异常断开自动重连,js实现crc校验位
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
async / await
Leakage relay jelr-250fg
【日常训练--腾讯精选50】235. 二叉搜索树的最近公共祖先
How digitalization affects workflow automation
Preliminary practice of niuke.com (9)
Unity keeps the camera behind and above the player
淘寶商品詳情頁API接口、淘寶商品列錶API接口,淘寶商品銷量API接口,淘寶APP詳情API接口,淘寶詳情API接口
[论文阅读] Semi-supervised Left Atrium Segmentation with Mutual Consistency Training
成为资深IC设计工程师的十个阶段,现在的你在哪个阶段 ?
Paper reading [MM21 pre training for video understanding challenge:video captioning with pre training techniqu]
Mybaits multi table query (joint query, nested query)
Reading the paper [sensor enlarged egocentric video captioning with dynamic modal attention]
爬虫练习题(三)
Flinksql read / write PgSQL
Nodejs get client IP
架构设计的五个核心要素
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
纪念下,我从CSDN搬家到博客园啦!