小程序实现加载列表
wxml中:
<view wx:for="{{keshiList}}" wx:key="id" data-id="{{item.id}}" bindtap="toDetail">
<image class="image2" src="{{item.heading}}"></image>
<view class="view4">
<view class="view5"></view>
<text class="text1">{{item.name}}</text>
</view>
<view class="view6"></view>
</view>
js文件中:
data: {
keshiList:[{id:1,name:'科室一'},{id:1,name:'科室二'},{id:1,name:'科室三'},{id:1,name:'科室四'},]
},
toDetail(options){
console.log(options);
},