Stabilize dashboard user search trigger

This commit is contained in:
sas.fajri
2026-05-08 09:50:43 +07:00
parent 3ed2b11016
commit ffe422f657
2 changed files with 24 additions and 5 deletions

View File

@@ -93,9 +93,11 @@ module.exports = {
pageSync: {
get() { return this.$store.state.dashboard_user.page },
set(val) {
if (val === this.$store.state.dashboard_user.page) return
this.$store.commit('dashboard_user/update_page', val)
this.doSearch(val)
let nextPage = Number(val) || 1
let currentPage = Number(this.$store.state.dashboard_user.page) || 1
if (nextPage === currentPage) return
this.$store.commit('dashboard_user/update_page', nextPage)
this.doSearch(nextPage)
}
}
},