uniapp分页
<uni-pagination @change="pageChanged" :current="pageIndex" :pageSize="pageSize" :total="pageTotle" class="pagination" />
let pageIndex = ref('0')
let pageSize = ref('50')
let pageTotle = ref('0')
//点击分页器的监听函数
function pageChanged(e) {
console.log(e.current);
pageIndex.value = e.current;
//请求后端数据
getActList()
}
async function getActList() {
const sutdentForm = {
actInfoId: uni.getStorageSync('actInfo').id,
isWork: "1",
name:name.value,
page:pageIndex.value,
size:pageSize.value
}
uni.showLoading()
try {
console.log('sutdentForm',sutdentForm)
const res = await getUserListPage(sutdentForm)
actList.value = res.rows
pageTotle.value = res.total
pageIndex.value = res.curPage
pageSize.value = res.pageSize
uni.hideLoading()
} catch (err) {
uni.hideLoading()
}
}