mirror of
https://gitee.com/ssssssss-team/magic-boot.git
synced 2025-01-19 03:52:50 +08:00
修复mb-table静态数据分页bug
This commit is contained in:
parent
3facdc9eba
commit
2aca3f0e78
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user