当前位置:网站首页>小程序 修改样式 ( placeholder、checkbox的样式)
小程序 修改样式 ( placeholder、checkbox的样式)
2022-07-05 18:24:00 【不求人0】
小程序 修改样式 ( placeholder、checkbox的样式)
小程序 修改样式 placeholder 样式
.wxml
<input placeholder="请输入用户名" placeholder-class="placeholderClass" />
.wxss
.placeholderClass{
font-weight: 400;
color: rgba(0, 0, 0, 0.14);
}
小程序 修改样式 ( checkbox的样式)
.wxml
<checkbox-group class="login-remember-check" bindchange="checkboxChange">
<label class="checkbox">
<checkbox class="login-remember-check-active" bindchange="checkboxChange" checked="{
{ isCheckPwd }}"/>
<text class="{
{ isCheckPwd ? 'login-remember-check' : 'login-remember-no-check' }}">记住用户名</text>
</label>
</checkbox-group>
.wxss
/* 修改checkbox的样式 */
checkbox .wx-checkbox-input.wx-checkbox-input-checked::before,
checkbox .wx-checkbox-input.wx-checkbox-input {
border-color:#14D1B4;
color: #14D1B4;
}
.js
data: {
isShowPwd:true, // 是否显示密码
showType:"text", // 密码与text的类型
isCheckPwd:false, // 是否记住用户名
},
// 切换密码格式
changePwdType(){
if (this.data.isShowPwd) {
//如果this.data.isShow为true,则表示为密码小黑点
this.setData({
isShowPwd:false,
showType:"password"
})
} else {
this.setData({
isShowPwd: true,
showType: "text"
})
}
},
// 记住用户名
checkboxChange(e){
console.log("checkboxChange",e.detail.value.length);
let resChecked = true
e.detail.value.length ? resChecked = true:resChecked = false
this.setData({
isCheckPwd:resChecked
})
},
.
- 效果
边栏推荐
- Vulnhub's darkhole_ two
- 让更多港澳青年了解南沙特色文创产品!“南沙麒麟”正式亮相
- 吴恩达团队2022机器学习课程,来啦
- 【PaddlePaddle】 PaddleDetection 人脸识别 自定义数据集
- rust统计文件中单词出现的次数
- 图像分类,看我就够啦!
- 线性表——抽象数据类型
- Pytorch yolov5 training custom data
- Cronab log: how to record the output of my cron script
- Share: ZTE Yuanhang 30 Pro root unlock BL magick ZTE 7532n 8040n 9041n brush mask original brush package root method Download
猜你喜欢
分享:中兴 远航 30 pro root 解锁BL magisk ZTE 7532N 8040N 9041N 刷机 刷面具原厂刷机包 root方法下载
IDEA配置npm启动
Can communication of nano
吴恩达团队2022机器学习课程,来啦
LeetCode 6109. 知道秘密的人数
Nanjing University: Discussion on the training program of digital talents in the new era
让更多港澳青年了解南沙特色文创产品!“南沙麒麟”正式亮相
基于can总线的A2L文件解析(3)
怎么自动安装pythn三方库
【HCIA-cloud】【1】云计算的定义、什么是云计算、云计算的架构与技术说明、华为云计算产品、华为内存DDR配置工具说明
随机推荐
[utiliser Electron pour développer le Bureau sur youkirin devrait]
音视频包的pts,dts,duration的由来.
Privacy computing helps secure data circulation and sharing
Login and connect CDB and PDB
[QNX hypervisor 2.2 user manual]6.3.2 configuring VM
The 10th global Cloud Computing Conference | Huayun data won the "special contribution award for the 10th anniversary of 2013-2022"
图片数据不够?我做了一个免费的图像增强软件
Failed to virtualize table with JMeter
Introduction to Resampling
《ClickHouse原理解析与应用实践》读书笔记(5)
LeetCode 6109. Number of people who know the secret
How can cluster deployment solve the needs of massive video access and large concurrency?
分享:中兴 远航 30 pro root 解锁BL magisk ZTE 7532N 8040N 9041N 刷机 刷面具原厂刷机包 root方法下载
@Extension、@SPI注解原理
IDEA配置npm启动
Nanjing University: Discussion on the training program of digital talents in the new era
Access the database and use redis as the cache of MySQL (a combination of redis and MySQL)
Use of print function in MATLAB
生词生词生词生词[2]
模拟百囚徒问题