如何获取通过wx:for创建的view的id
< view class = 'listPage' hover-class = 'listPageSelect' wx:for = "{{sharedCourseInfo}}" data-index = '{{index}}' style = "flex-direction:column;" bindtap = 'selectSharedCoursePage' wx:for-index = "index" > < view class = 'justForGetID' >{{sharedCourseInfo[index]['_id']}}</ view > < view class = 'flex-wrp-row item' > < view class = 'item-left flex-wrp-row' > < text class = 'textOfHead' >{{sharedCourseInfo[index]['courseName']}}</ text > </ view > < view class = 'item-right flex-wrp-row' > < text class = 'textOfHead' >{{sharedCourseInfo[index]['teacherName']}}</ text > </ view > </ view > </ view > |
老哥们,我通过wx:for创建view,想在点击的时候获取点击的是第几块view,方便我进行下一步页面的渲染,请问下怎么在点击时获取第几个view呢