当前位置:网站首页>微信小程序密码显示隐藏(小眼睛)
微信小程序密码显示隐藏(小眼睛)
2022-07-17 05:09:00 【一指流沙q】
一、效果图
微信小程序密码显示隐藏(小眼睛)
![]()
![]()
二、代码
wxml
<view>
<input type="text" password="{
{pwdtype}}" />
<image src="{
{image}}" mode="aspectFit" bindtap="goto"></image>
</view>wxss
view {
display: flex;
justify-content: center;
}
input {
width: 50%;
border-bottom: 1px solid black;
}
image {
width: 48rpx;
height: 48rpx;
/* border: 1px solid black; */
}js
Page({
/**
* 页面的初始数据
*/
data: {
pwdtype: true,
image: '/images/眼睛_隐藏_o.png'
},
goto() {
if (this.data.pwdtype == true) {
this.setData({
pwdtype: false,
image: '/images/眼睛_显示_o.png'
})
} else {
this.setData({
pwdtype: true,
image: '/images/眼睛_隐藏_o.png'
})
}
}
})注意:真机测试不能使用
图片下载地址:iconfont-阿里巴巴矢量图标库
边栏推荐
- 一次全面的性能优化,从5秒优化到1秒
- throttle/debounce应用及原理
- Spark核心编程(4)--Spark运行架构
- 4. Neusoft cross border e-commerce data warehouse project - user behavior data acquisition channel construction of data acquisition channel construction (2022.6.1-2022.6.4)
- Redis source code analysis dynamic string implementation (SDS)
- 共用(联合)体
- 从20s优化到500ms,我用了这三招
- 解决idea新建module 提示module xxxx does exitst
- Parent components plus scoped sometimes affect child components
- 2. Technology selection of Neusoft cross border e-commerce data warehouse project
猜你喜欢

4. Neusoft cross border e-commerce data warehouse project - user behavior data acquisition channel construction of data acquisition channel construction (2022.6.1-2022.6.4)

MySQL学习笔记(5)——JOIN联表查询,自连接查询,分页和排序,子查询与嵌套查询

8.数据仓库之ODS层搭建

Is the software testing training of lemon class reliable? This successful case of counter attack from the training class tells you

面渣逆袭:线程池夺命连环十八问,面试官直夸我

软件测试就业前景怎样 人才需求大,岗位稳定性强

Use iceberg in CDP to pressurize the data Lake warehouse

面试官:大量请求 Redis 不存在的数据,从而影响数据库,该如何解决?

电商用户行为实时分析系统(Flink1.10.1)

Minor problems of GCC compiling C language in ubantu
随机推荐
时间差计算
C语言文件的操作
mysql的事务
二叉树的先序、中序、后序遍历
ambari集群扩容节点+扩容服务操作
LiveData浅析
[bug solution] org apache. ibatis. type. TypeException: The alias ‘xxxx‘ is already mapped to the value ‘xxx‘
pymongo模糊查询
面渣逆袭:线程池夺命连环十八问,面试官直夸我
正则替换group(n)内容
2. Technology selection of Neusoft cross border e-commerce data warehouse project
gradle自定义插件
C语言的高级操作
Use Flink SQL to transfer market data 1: transfer VWAP
Is the cookie valid for a limited time? How to set cookies? Teach you to set by hand
1.东软跨境电商数仓需求规格说明文档
Using Flink SQL to fluidize market data 2: intraday var
3.东软跨境电商数仓项目架构设计
4. Neusoft cross border e-commerce data warehouse project - user behavior data acquisition channel construction of data acquisition channel construction (2022.6.1-2022.6.4)
Minor problems of GCC compiling C language in ubantu