Small program for loop to add different styles

Add a custom index and then perform trinocular judgment based on the custom index

 <block a:for="{
    
    {icon}}">
        <view class='{
    
    {index===0?"integral1":index===1?"integral2":index===2?"integral3":index===3?"integral4":index===4?"integral5":""}}'data-index='{
    
    {index}}' onTap="effect">
          <image class="hear-integral-icon" src="/images/integral-icon.png"/>
        </view>
      </block>```

Guess you like

Origin blog.csdn.net/weixin_51110842/article/details/117701712