修复mb-table静态数据分页bug

This commit is contained in:
吕金泽 2022-05-22 22:19:50 +08:00
parent 3facdc9eba
commit 2aca3f0e78

View File

@ -212,11 +212,15 @@ function handlerData() {
listLoading.value = true
total.value = props.data.length
var currPageData = []
props.data.forEach((it, i) => {
if (i >= ((listCurrent.value - 1) * props.limit) && i < (listCurrent.value * props.limit) && currPageData.length < props.limit) {
currPageData.push(it)
}
})
if(props.page){
props.data.forEach((it, i) => {
if (i >= ((listCurrent.value - 1) * props.limit) && i < (listCurrent.value * props.limit) && currPageData.length < props.limit) {
currPageData.push(it)
}
})
}else{
currPageData = props.data
}
list.value = currPageData
props.done()
listLoading.value = false