This commit is contained in:
menxipeng
2025-09-13 14:20:20 +08:00
parent a14edb27c1
commit 9e75f226b9
21 changed files with 121 additions and 80 deletions

View File

@@ -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)