当前位置:网站首页>小程序 修改样式 ( 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
})
},
.
- 效果

边栏推荐
- 兄弟组件进行传值(显示有先后顺序)
- 图像分类,看我就够啦!
- LeetCode 6109. Number of people who know the secret
- websocket 工具的使用
- Clickhouse (03) how to install and deploy Clickhouse
- SAP 特征 特性 说明
- New words new words new words new words [2]
- 瀚升优品app翰林优商系统开发功能介绍
- Xiaobai getting started with NAS - quick building private cloud tutorial series (I) [easy to understand]
- Simulate the hundred prisoner problem
猜你喜欢

websocket 工具的使用

如何写出好代码 - 防御式编程

图片数据不够?我做了一个免费的图像增强软件

使用JMeter录制脚本并调试

案例分享|金融业数据运营运维一体化建设

node_ Exporter memory usage is not displayed

Failed to virtualize table with JMeter

Privacy computing helps secure data circulation and sharing

Find the first k small element select_ k

Record eval() and no in pytoch_ grad()
随机推荐
Electron安装问题
图片数据不够?我做了一个免费的图像增强软件
New words new words new words new words [2]
瞅一瞅JUC提供的限流工具Semaphore
Wu Enda team 2022 machine learning course, coming
Introduction to the development function of Hanlin Youshang system of Hansheng Youpin app
IDEA配置npm启动
瀚升优品app翰林优商系统开发功能介绍
Personal understanding of convolutional neural network
小林coding的内存管理章节
sample_ What is the relationship between rate, sample and duration
Notes on common management commands of openshift
Is it safe to open an account and register stocks for stock speculation? Is there any risk? Is it reliable?
websocket 工具的使用
How to solve the error "press any to exit" when deploying multiple easycvr on one server?
@Extension、@SPI注解原理
LeetCode 6109. 知道秘密的人数
English sentence pattern reference
Thoroughly understand why network i/o is blocked?
Let more young people from Hong Kong and Macao know about Nansha's characteristic cultural and creative products! "Nansha kylin" officially appeared