Bug
单独改变一个值,其余的样式就不渲染了
—————————————————————————————————————
代码
<!–student/pages/reservation/evaluation/component/label/label.wxml–>
<view class=‘label_box’>
<view wx:for=’{{list}}’ data-item="{{item}}" bindtap=‘click’>
<text class="{{item.statu==true?‘select’:’’}}">{{item.text}}</text>
</view>
</view>
/* student/pages/reservation/evaluation/component/label/label.wxss */
.label_box{width: 100%; padding: 5px 0; overflow: hidden;}
.label_box text{float: left; padding: 0 10px; border: 1px solid #ddd; color: #666; font: 12px/25px ‘微软雅黑’; border-radius: 4px; margin: 5px;}
.label_box text.select{border-color:#f60; color: #fff; background: #f60;}
//快捷标签
change_label(e) {
for (var i = 0; i < this.data.label_list.length;i++){
console.log(this.data.label_list[i].id== e.detail.label.id)
if (this.data.label_list[i].id== e.detail.label.id){
this.data.label_list[i].statu = !this.data.label_list[i].statu
console.log(this.data.label_list)
this.setData({ label_list: this.data.label_list})
}
}
},
—————————————————————————————————————
—————————————————————————————————————
点击前
—————————————————————————————————————
—————————————————————————————————————
点击后
点击第二个标签以后,数据看起来是对的,同样的样式第二个能渲染第三个却不显示了,是我的代码有问题嘛