方法一
<!-- index.wxml -->
<view class='top'>
<view class="{
{ currentTab == index ? 'active' : '' }}" wx:for="{
{top}}" wx:key="{
{lalala}}" bindtap="{
{ currentTab != index ? 'navbarTap':'navbarTap' }}" id="{
{index}}" >{
{
item}}</view>
</view>
.top{
display