|
[云开发]
v-for的index类型是string不是number
[复制链接]
平台:ios,Android
问题:使用v-for,index是string类型的,下面的图片,正常来说应该是1和2
- <view v-for="(item, index) in list" :key="item.id"
- class="position-rel disflex-v-center width-100p margin-bottom-15 margin-top-14">
- <image v-show="index > 0" src="../../image/icon-056.png" mode="aspectFit" class="item-line" />
- <view class="item-index disflex-middle">
- <text class="item-index-text font-Oswald-m">{{index + 1}}</text>
- </view>
- </view>
复制代码
|
|