fenye
This commit is contained in:
@@ -65,6 +65,7 @@ export default {
|
||||
return {
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
currentPage: {
|
||||
get() {
|
||||
@@ -98,16 +99,6 @@ export default {
|
||||
}
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
// 计算最大页数,进行边界检查
|
||||
const maxPage = Math.ceil(this.total / this.pageSize) || 1;
|
||||
|
||||
// 如果请求的页码超出范围,限制在有效范围内
|
||||
if (val > maxPage) {
|
||||
val = maxPage;
|
||||
} else if (val < 1) {
|
||||
val = 1;
|
||||
}
|
||||
|
||||
this.$emit('pagination', { page: val, limit: this.pageSize })
|
||||
if (this.autoScroll) {
|
||||
scrollTo(0, 800)
|
||||
|
||||
Reference in New Issue
Block a user