fix: 修复table分页页码bug
This commit is contained in:
@@ -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>/ {{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 () {
|
||||
|
||||
@@ -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)
|
||||
})
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user