fix incorrect switching between pages (#5608)

This commit is contained in:
Hoang Nguyen 2021-10-22 18:59:38 +07:00 committed by GitHub
parent de6293b6f7
commit 646b95567f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 4 deletions

View File

@ -431,8 +431,8 @@
:total="vmCount"
:showTotal="total => `${$t('label.total')} ${total} ${$t('label.items')}`"
:pageSizeOptions="['10', '20', '40', '80', '100']"
@change="handleChangePage"
@showSizeChange="handleChangePageSize"
@change="handleChangeVmPage"
@showSizeChange="handleChangeVmPageSize"
showSizeChanger>
<template slot="buildOptionText" slot-scope="props">
<span>{{ props.value }} / {{ $t('label.page') }}</span>
@ -1325,6 +1325,16 @@ export default {
this.pageSize = pageSize
this.fetchData()
},
handleChangeVmPage (page, pageSize) {
this.vmPage = page
this.vmPageSize = pageSize
this.fetchVirtualMachines()
},
handleChangeVmPageSize (currentPage, pageSize) {
this.vmPage = currentPage
this.vmPageSize = pageSize
this.fetchVirtualMachines()
},
onSearch (value) {
this.searchQuery = value
this.fetchVirtualMachines()

View File

@ -276,8 +276,8 @@
:total="vmCount"
:showTotal="total => `${$t('label.total')} ${total} ${$t('label.items')}`"
:pageSizeOptions="['10', '20', '40', '80', '100']"
@change="handleChangePage"
@showSizeChange="handleChangePageSize"
@change="handleChangeVmPage"
@showSizeChange="handleChangeVmPageSize"
showSizeChanger>
<template slot="buildOptionText" slot-scope="props">
<span>{{ props.value }} / {{ $t('label.page') }}</span>
@ -793,6 +793,16 @@ export default {
this.pageSize = pageSize
this.fetchData()
},
handleChangeVmPage (page, pageSize) {
this.vmPage = page
this.vmPageSize = pageSize
this.fetchVirtualMachines()
},
handleChangeVmPageSize (currentPage, pageSize) {
this.vmPage = currentPage
this.vmPageSize = pageSize
this.fetchVirtualMachines()
},
onSearch (value) {
this.searchQuery = value
this.fetchVirtualMachines()