fix: 修复table分页页码bug

This commit is contained in:
chenjinsong
2021-08-27 15:08:37 +08:00
parent 4b5b6e5097
commit 2433bd7fec
2 changed files with 12 additions and 1 deletions

View File

@@ -1,10 +1,12 @@
<template>
<el-pagination
small
ref="pagination"
layout="prev,jumper,slot,next"
class="chart-table-pagination"
:total="total"
:page-size="pageSize"
v-model:currentPage="pageNo"
@current-change="current"
>
<span>/&nbsp;{{totalPage}}</span>
@@ -20,7 +22,8 @@ export default {
},
data () {
return {
pageSize: chartTableDefaultPageSize
pageSize: chartTableDefaultPageSize,
pageNo: 1
}
},
computed: {
@@ -36,6 +39,10 @@ export default {
methods: {
current (val) {
this.$emit('pageJump', val)
},
resetPageNo () {
console.info(11)
this.pageNo = 1
}
},
mounted () {

View File

@@ -176,6 +176,7 @@
</template>
<template #footer>
<chart-table-pagination
ref="tablePagination"
:total="table.tableData.length"
@pageJump="pageJump"
></chart-table-pagination>
@@ -947,6 +948,9 @@ export default {
this.errorInfo = response.msg || response.message || 'Unknown'
}
}).finally(() => {
this.$nextTick(() => {
this.$refs.tablePagination.resetPageNo()
})
setTimeout(() => { this.loading = false }, 250)
})
},