小程序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.红色为区别部分


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM