JS:
Page({
data: {
list_data: [],
title: “正在加载数据…”
},
onLoad: function () {
var that = this
that.setData({
list_data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
})
},
onReachBottom: function () {
var that = this
setTimeout(function () {
that.setData({
list_data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19],
title: “数据加载完毕”
})
}, 1000)
}
})
JSON:
{
“enablePullDownRefresh”: true
}
WXML:
item{{item}}
{{title}}
WXSS:
.class_list{
background-color: #fff;
color: #000;
}
.class_item{
border-bottom: solid #f5f5f5 1px;
padding: 20px;
}
.class_item_end{
text-align: center;
}
page{
background-color: #f5f5f5;
}