在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
<view class="tab-left" bindtap="tab"> <view class="{{tabArr.curHdIndex=='0'? 'active' : ''}}" >tab-hd01</view> <view class="{{tabArr.curHdIndex=='1'? 'active' : ''}}" >tab-hd01</view> <view class="{{tabArr.curHdIndex=='2'? 'active' : ''}}" >tab-hd01</view> <view class="{{tabArr.curHdIndex=='3'? 'active' : ''}}" >tab-hd01</view> </view> <view class="tab-right"> <view class="right-item {{tabArr.curBdIndex=='0'? 'active' : ''}}">tab-bd01</view> <view class="right-item {{tabArr.curBdIndex=='1'? 'active' : ''}}">tab-bd02</view> <view class="right-item {{tabArr.curBdIndex=='2'? 'active' : ''}}">tab-bd03</view> <view class="right-item {{tabArr.curBdIndex=='3'? 'active' : ''}}">tab-bd04</view> </view> </view> js代码
/** * tab切换 */ tab: function(e) { var dataId = e.currentTarget.id; var obj = {}; obj.curHdIndex = dataId; obj.curBdIndex = dataId; this.setData({ tabArr: obj }) },
|
请发表评论