小程序tableview效果

.js

Page({
	data: {
		list: [],
	},
	onLoad: function () {
		console.log('onLoad')
		var that = this
               
                that.setData({
			list: /***设置list数据***/,
				});

.wxml

<view wx:for="{{list}}" style="width:100%">
    <image class="image" id="{{index}}" mode="aspectFit" src="{{item.firstpic}}"></image>
    <label class="time">{{item.time}}</label>
    <label class="title">{{item.title}}</label>
    <label class="address">{{item.address}}</label>
  </view>

猜你喜欢

转载自blog.csdn.net/chenjin360/article/details/54943893