当前位置:网站首页>原生小程序 之 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,
})
}
},
边栏推荐
- ForkJoin最全详解(从原理设计到使用图解)
- What is dependency injection (DI)
- Dj-zbs2 leakage relay
- DOM node object + time node comprehensive case
- 如何提高网站权重
- zabbix_ Get test database failed
- 分布式事务解决方案之TCC
- nVisual网络可视化
- Design, configuration and points for attention of network arbitrary source multicast (ASM) simulation using OPNET
- 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
猜你喜欢
随机推荐
1. AVL tree: left-right rotation -bite
什么是依赖注入(DI)
Polynomial locus of order 5
bat 批示处理详解
Preliminary practice of niuke.com (9)
4. Object mapping Mapster
Design, configuration and points for attention of network arbitrary source multicast (ASM) simulation using OPNET
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
AI人脸编辑让Lena微笑
Leetcode: maximum number of "balloons"
淘宝商品详情页API接口、淘宝商品列表API接口,淘宝商品销量API接口,淘宝APP详情API接口,淘宝详情API接口
MySQL-CentOS7通过YUM安装MySQL
Three level menu data implementation, nested three-level menu data
ssm框架的简单案例
Taobao commodity details page API interface, Taobao commodity list API interface, Taobao commodity sales API interface, Taobao app details API interface, Taobao details API interface
Nodejs get client IP
Flinksql 读写pgsql
5. 数据访问 - EntityFramework集成
Dj-zbs2 leakage relay
Win configuration PM2 boot auto start node project