微信小程序 修改默認單選,多選按鈕樣式
1.在微信開發者文檔中復制一份單選或者多選的代碼
<!--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
/* 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了。
注:僅記錄方便開發查找。