uniapp 下拉刷新分页

onLoad() {
			this.getList()
			setTimeout(function() {
			}, 1000);
			uni.startPullDownRefresh();
		},
		onPullDownRefresh() {
			let _self = this
			setTimeout(function() {
				uni.stopPullDownRefresh();
				_self.current = 1;
				_self.getList();
			}, 1000);
		},
		onReachBottom() {
			let _self = this
			uni.showNavigationBarLoading()
			setTimeout(function() {
				_self.current++;
				_self.getList();
				uni.hideNavigationBarLoading()
			}, 2000);
		},
getList() {
		this.$u.api.***({id:1}).then(res => {
			if (res.code == 2000) {
				if (this.current != 1) {
					this.dataList = this.dataList.concat(res.data.records)
				} else {
					this.dataList = res.data.records
				}
			}
		})
	}

你可能感兴趣的:(前端,前端vue,uniapp,vue.js,javascript,前端)