isuansuan

1.wxml中

<view class="column">
<view class="body-view {{num==1?\'active\':\'\'}}" bindtap="bindChoice" data-num=\'1\'>推荐</view>
<view class="body-view {{num==2?\'active\':\'\'}}" bindtap="bindChoice" data-num=\'2\'>热门</view>
<view class="body-view {{num==3?\'active\':\'\'}}" bindtap="bindChoice" data-num=\'3\'>分类</view>
</view>
2.js中
data{
   num:1
}
bindChoice:function(e){
   console.log(e);
   this.setData({
        num:e.target.dataset.num
})
}

分类:

技术点:

相关文章:

  • 2021-12-20
  • 2022-12-23
  • 2022-12-23
  • 2021-07-17
  • 2021-10-05
  • 2021-10-09
  • 2021-12-04
猜你喜欢
  • 2021-12-12
  • 2022-01-02
  • 2022-03-02
  • 2021-12-12
  • 2021-10-13
  • 2022-01-07
相关资源
相似解决方案