小程序class&style和三元表达式的结合使用

class:

<view class="tab-item {{currentTab==0 ? 'on' : ''}}" >我要取票</view>
 
style:
 
<view  current="{{currentTab}}"  style="height:{{currentTab==1?Height+'rpx':'100%'}}">我要取票</view>
 
提示:
 
1.currentTab,Height为data中的数据
 
2.红色为区别部分
posted @ 2017-12-18 17:26  红叶1994  阅读(14205)  评论(0编辑  收藏  举报