網站首頁 編程語言 正文
?
?
?wxml
<view bindtap='checkedTap'>
<radio checked="{{checked}}">設為默認</radio>
</view>
wxss
<style lang="less" >
radio .wx-radio-input {
border-radius: 50%; /* 圓角 */
width: 24rpx;
border: 2rpx solid #5e5e5f;
height: 24rpx;
}
radio .wx-radio-input.wx-radio-input-checked {
border: none;
background: #c1885a;
}
radio .wx-radio-input.wx-radio-input-checked::before {
border-radius: 50%; /* 圓角 */
width: 28rpx; /* 選中后對勾大小,不要超過背景的尺寸 */
height: 28rpx; /* 選中后對勾大小,不要超過背景的尺寸 */
line-height: 28rpx;
text-align: center;
font-size: 20rpx; /* 對勾大小 30rpx */
color: #fff; /* 對勾顏色 白色 */
background: #c1885a;
transform: translate(-50%, -50%) scale(1);
}
</style>
在點擊事件中,通過取反即可實現選中與取消。?
js?
data: {
checked:true
},
//是否選中
checkedTap: function () {
this.setData({
"checked": !this.data.checked
})
},
原文鏈接:https://blog.csdn.net/weixin_43923808/article/details/131982167
- 上一篇:沒有了
- 下一篇:沒有了
相關推薦
- 2023-06-17 C#?輸出參數out問題_C#教程
- 2022-09-23 基于React路由跳轉的幾種方式_React
- 2022-03-15 跨域報錯:Response to preflight request doesn‘t pass ac
- 2022-07-09 鼠標事件-事件對象
- 2022-09-21 jquery實現網頁左側導航菜單欄_jquery
- 2022-07-25 Android?嵌套?Intent?隱患及解決方案_Android
- 2022-03-18 C#?利用Autofac批量接口注入依賴的問題小結_C#教程
- 2022-04-22 mac安裝oh-my-zsh出現command not found: npm問題解決
- 欄目分類
-
- 最近更新
-
- window11 系統安裝 yarn
- 超詳細win安裝深度學習環境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區別,Jav
- spring @retryable不生效的一種
- Spring Security之認證信息的處理
- Spring Security之認證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權
- redisson分布式鎖中waittime的設
- maven:解決release錯誤:Artif
- restTemplate使用總結
- Spring Security之安全異常處理
- MybatisPlus優雅實現加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務發現-Nac
- Spring Security之基于HttpR
- Redis 底層數據結構-簡單動態字符串(SD
- arthas操作spring被代理目標對象命令
- Spring中的單例模式應用詳解
- 聊聊消息隊列,發送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠程分支