wxml:
代码语言:javascript复制<view class="spec">
< view class= "values" >
< view class= "value {{valueitem.checked?'selected':''}}" bindtap= "clickSkuValue" wx:for-item= "valueitem"
wx:for= "{{valueitem.valueList}}" wx:key= "id" data-value-id= "{{valueitem.id}}" data-value= "{{item.name}}" >
{{ valueitem.value}}
</ view >
</ view >
</view>
wxss:
代码语言:javascript复制.spec .value .selected {
border: 1px solid #b4282d ;
color: #b4282d ;
background: #e64340 ;
}
坑的地方:wxss中 spec和value之间要有空格,value和selected直接不能有空格,否则没有选中效果