微信小程式遍歷迴圈中點選新增樣式
阿新 • • 發佈:2019-01-01
.wxml中:
<view class='section'>
<scroll-view id='sv' scroll-y style="width:150rpx;height:{{hei}}px;">
<block wx:for="{{leftMenu}}"wx:key='this'>
<block wx:if="{{index == clickId}}">
<view bindtap='changeWhite' class='fff' id='{{index}}'>
{{item}}
</view>
</block>
<blockwx:else>
<view bindtap='changeWhite' class='eee' id='{{index}}'>
{{item}}
</view>
</block>
</block>
</scroll-view>
</view>