问一个关于{{}}的小白问题
发布于 6 年前 作者 dongfang 12989 次浏览 来自 问答

<template name=‘report_head’>

<view class=“tab-item {{currentTab==0?‘active’:’’}}” data-current=“0” bindtap=“swichNav”>1</view>

</template>

这里我打算进行循环遍历,有没有办法将下图画圈进行自增,

{{0++}},不起用

2 回复

0写成index就行了

<template name='report_head'>

<view class="tab-item {{currentTab==0?'active':''}}" wx:for="{{ arr }}" data-current="{{  index }}" bindtap="swichNav">1</view>

</template>

回到顶部