微信小程序标签动态控制显示样式和class


 

  <view style="color: red;background: blue">测试</view>
  <view style="color: red;background: {{ true?'blue':'' }}">测试</view>
  <view style="color: {{ true?'red':'' }};background: {{ true?'blue':'' }};padding-top: 50rpx">测试</view>

 

  <view class="example1 example2">测试</view>
  <view class="example1 {{true?'example2':''}}">测试</view>
  <view class="{{true?'example1':''}} {{true?'example2':''}} example3">测试</view>

 


免责声明!

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



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