三元运算无法执行,?
小弟想做个样式更改的,但不知为啥三元运算没结果出来 求大佬指导
hxml
<scroll-view class="left_content" scroll-y>
<view class="cata_name {{num==cur_num? 'active' : ' '}}" wx:for="{{catagory_left_list}}" wx:for-item="cata_item" wx:key="cata" data-num="{{index}}" bindtap="changePage">{{cata_item.cat_name}}</view>
</scroll-view>
js
data: {
catagory_left_list:[],
catagory_right_list:[],
cur_num:0
}
changePage:function(e){
console.log(e)
let index = e.currentTarget.dataset.num;
this.setData({
cur_num:index,
catagory_right_list:this.catas[e.currentTarget.dataset.num].children
})
}