<view class="{{theindex==index?'left-item-active':'left-item'}}" bindtap="changeIndex" data-item="{{item}}"
data-index="{{index}}">
{{item.name}}
</view>
changeIndex(e) {
// console.log(e.currentTarget.dataset.item, e.currentTarget.dataset.index);
this.setData({
theindex: e.currentTarget.dataset.index
})
},
.left-item {
padding: 15px 5px;
}
.left-item-active{
padding: 15px 5px;
background: #fff;
}