html
<view hidden=’{{all_hide}}’>
<view wx:for=’{{history_list}}’ wx:key=‘index’ class=‘history_list’ bindtap=‘historyList’ data-listIndex=’{{index}}’>
<view class=‘content’>
<view>{{item.source}}</view>
<view>{{item.createTime}}</view>
</view>
<view class="{{item.changeColor}}">{{item.money}}</view>
</view>
</view>
js
historyList:function(e){
var that = this;
var i = e.target.dataset.listindex;
var detail = that.data.history_list;
console.log(i)
}列表渲染,然后对列表内的数据进行单独的详情展示,但是listIndex,打印出来有时有值,有时undefined