<view class="{{index == 0 ? 'getFocus' : 'lostFocus'}}" style="color:{{ newNoite ? 'red' :'#eee'}}">常用</view>
index在js 的data里,getFocus和lostFocus是wxss的两个样式
本文详细介绍了在微信小程序中如何使用index变量结合JS数据和WXSS样式类实现动态的UI展示效果,具体展示了如何根据条件改变文本颜色。
<view class="{{index == 0 ? 'getFocus' : 'lostFocus'}}" style="color:{{ newNoite ? 'red' :'#eee'}}">常用</view>
index在js 的data里,getFocus和lostFocus是wxss的两个样式
1449
3386
3171
781

被折叠的 条评论
为什么被折叠?