微信小程序 修改默认单选,多选按钮样式

微信小程序 修改默认单选,多选按钮样式

1.在微信开发者文档中复制一份单选或者多选的代码
javascript 复制代码
<!--pages/index3/index.wxml-->
<radio-group bindchange="radioChange">
        <label class="weui-cell weui-check__label" style="display: flex;">
            <radio value="1" checked="true"/>
          <view class="weui-cell__bd">按钮1</view>
        </label>
        <label class="weui-cell weui-check__label" style="display: flex;">
            <radio value="1" checked="true"/>
          <view class="weui-cell__bd">按钮1</view>
        </label>
        <label class="weui-cell weui-check__label" style="display: flex;">
            <radio value="1" checked="true"/>
          <view class="weui-cell__bd">按钮1</view>
        </label>
      </radio-group>
2. 根据情况复制单选或者多选代码即可

index.wxss

javascript 复制代码
/* pages/index3/index.wxss */
/* 单选按钮样式 */
.wx-radio-input {
    width: 32rpx !important;
    height: 32rpx !important;
    border-radius: 100%;
    background-color: #fff !important;
  }
  /*勾选样式 */
  .wx-radio-input.wx-radio-input-checked {
    border: none !important;
    background-color: #6784f5 !important;
  }

  /* 多选框样式 */

  /* 未勾选样式 */
.wx-checkbox-input {
  width: 33rpx !important;
  height: 33rpx !important;
}
/* 勾选样式 */
.wx-checkbox-input.wx-checkbox-input-checked{
  border-color:#6784f5 !important;
  background:#6784f5 !important;
}

  

这样就ok了。

注:仅记录方便开发查找。

相关推荐
咸虾米2 分钟前
微信小程序通过uni.chooseLocation打开地图选择位置,相关设置及可能出现的问题
vue.js·微信小程序
AAA修煤气灶刘哥5 分钟前
微信小程序+Spring Boot:三步教你搞定微信小程序登录+Token加密+全局拦截器
spring boot·后端·微信小程序
yw00yw27 分钟前
小程序插件使用
java·小程序·apache
00后程序员张36 分钟前
iOS 应用上架常见问题与解决方案,多工具组合的实战经验
android·ios·小程序·https·uni-app·iphone·webview
weixin_lynhgworld11 小时前
从闲置到珍宝:旧物回收小程序系统重塑物品价值
小程序·旧物回收
2501_9160074716 小时前
iOS App 上架实战 从内测到应用商店发布的全周期流程解析
android·ios·小程序·https·uni-app·iphone·webview
小小怪下士_---_1 天前
uniapp开发微信小程序自定义导航栏
前端·vue.js·微信小程序·小程序·uni-app
摸着石头过河的石头1 天前
小程序调试全攻略:微信/支付宝避坑指南,小白也能一次通关
前端·微信小程序
fakaifa2 天前
点大餐饮独立版系统源码v1.0.3+uniapp前端+搭建教程
小程序·uni-app·php·源码下载·点大餐饮·扫码点单
Dignity_呱2 天前
如何在不发版时,实现小程序的 AB 测试?
前端·面试·微信小程序