在page.json中将enablePullDownRefresh
设置为true,还发现enablePullDownRefresh:true
后面不能加逗号就会报错
pages.json解析失败
17:40:55.914 TypeError: Cannot read property 'subpackages' of undefined
Error: uni-app-compiler: Unexpected token } in JSON at position 387
放代码
{
"path": "pages/Project-library/list/index",
"style": {
"navigationBarTitleText": "项目列表",
"onReachBottomDistance": 20, //距离底部多远时触发 单位为px
"enablePullDownRefresh": true //设置参数为true
}
}
在页面中添加触底函数onReachBottom
跟onshow同级,用的uview2.0的 <u-loadmore :status="status" :loading-text="loadingText" :loadmore-text="loadmoreText" :nomore-text="nomoreText" />
onReachBottom(){
this.datainfo.page++
//调用列表请求函数
this.getlist()
}
},