<view class="tab-left" bindtap="tab">
<view class="{{tabArr.curHdIndex=='0'? 'active' : ''}}" id="tab-hd01" data-id="0">tab-hd01</view>
<view class="{{tabArr.curHdIndex=='1'? 'active' : ''}}" id="tab-hd02" data-id="1">tab-hd01</view>
<view class="{{tabArr.curHdIndex=='2'? 'active' : ''}}" id="tab-hd03" data-id="2">tab-hd01</view>
<view class="{{tabArr.curHdIndex=='3'? 'active' : ''}}" id="tab-hd04" data-id="3">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代码

Page( {
data: {
tabArr: {
curHdIndex: 0,
curBdIndex: 0
},
},
 /**
* tab切换
*/
tab: function(e) {
var dataId = e.currentTarget.id;
var obj = {};
obj.curHdIndex = dataId;
obj.curBdIndex = dataId;
this.setData({
tabArr: obj
})
},

最新文章

  1. mysql 队列 实现并发读
  2. Appium(客户端版)解决每次运行Android,都安装Appium Setting和Unlock的方法
  3. 苹果IOS开发者账号总结--发布应用APP时team name是否可以随意写?
  4. uGUI练习 开篇
  5. (转载)StringGrid常用属性和常用操作
  6. Starting and Stopping Oracle Fusion Middleware
  7. VNC配置连接远程服务器桌面-linux\windows
  8. HDU 1131 Count the Trees
  9. c++构造析构顺序
  10. Java一流的施工顺序
  11. 人工智能算法综述(二) RNN and LSTM
  12. tcpdump常用参数说明及常见操作
  13. Git使用入门笔记
  14. 【ABP框架系列学习】N层架构(3)
  15. migrate数据库迁移
  16. A new session could not be created. (Original error: Requested a new session but one was in progress) (WARNING: The server did not provide any stacktrace information)
  17. json&amp;pickle&amp;shelve模块
  18. java常见面试题及三大框架面试
  19. 【2】C#读取文本文件
  20. &lt;转&gt;HTML、CSS、font-family:中文字体的英文名称

热门文章

  1. C++重载运算简介
  2. 【二分】【P1314】 【NOIP2011D2T2】聪明的质监员
  3. java使用POI操作XWPFDocument中的XWPFParagraph(段落)对象的属性略解
  4. JavaScript中Unicode值转字符
  5. hdu 5625
  6. bzoj 1564 [NOI2009]二叉查找树 区间DP
  7. [技巧篇]12.从Spring的编码过滤器说起
  8. Small Multiple
  9. lua 闪电特效
  10. vue_真机调试页面