html
<view class="radio-out" :style="{'border-color': selectFlag?'blue':''}"> <view class="radio-in" :style="{'background-color': selectFlag?'blue':''}"> </view> </view>
js
selectFlag: false,
changeSelect() { console.log(this.selectFlag) this.selectFlag = !this.selectFlag }
css
.radio-out { display: flex; width: 32rpx; height: 32rpx; border: 1px solid #ccc; border-radius: 1em; justify-content: center; align-items: center; margin: 10rpx; } .radio-in { display: flex; width: 16rpx; height: 16rpx; border-radius: 1em; }
最终样式--点击前
点击后
标签:自定义,32rpx,一个,16rpx,selectFlag,radio,border From: https://www.cnblogs.com/u1234567/p/18181468