小程序里如何切换class

版权声明:本文为博主原创文章,码字不易,转载请先经本人同意。 https://blog.csdn.net/promiseCao/article/details/84247674
<text wx:for="{{titles}}" wx:key="{{item}}" 

class="home-title {{index == activeIndex ? 'active' : ''}}" 

bindtap='changeClassify'> {{item.name}} </text>


 // index == activeIndex classw为 "home-title active" 否则为 "home-title "

猜你喜欢

转载自blog.csdn.net/promiseCao/article/details/84247674