//for循环模板postItem
<block wx:for="{{postList}}" wx:for-item="item" wx:for-index="idx">
<template is="postItem" data="{{...item}}"/>
</block>
//template模板获取for循环里的下标idx的值
<template name="postItem">
<text class="post-title">{{idx}}</text>
</template>
//现在问题是模板里获取不到for循环里的下标idx
可以了,谢谢
https://developers.weixin.qq.com/blogdetail?action=get_post_info&docid=9412f5ddb4a426747836a7fd49b6baf6&highline=小程序%20template%20wx%3Afor%20index&token=1019146719&lang=zh_CN