Merge pull request #1147 from DaydreamCoding/feat/persisted-page-size

feat(frontend): 分页 pageSize 持久化到 localStorage,刷新后自动恢复
This commit is contained in:
Wesley Liddick
2026-03-19 21:53:54 +08:00
committed by GitHub
15 changed files with 57 additions and 14 deletions

View File

@@ -122,6 +122,7 @@ import { computed, ref } from 'vue'
import { useI18n } from 'vue-i18n'
import Icon from '@/components/icons/Icon.vue'
import Select from './Select.vue'
import { setPersistedPageSize } from '@/composables/usePersistedPageSize'
const { t } = useI18n()
@@ -216,6 +217,7 @@ const goToPage = (newPage: number) => {
const handlePageSizeChange = (value: string | number | boolean | null) => {
if (value === null || typeof value === 'boolean') return
const newPageSize = typeof value === 'string' ? parseInt(value) : value
setPersistedPageSize(newPageSize)
emit('update:pageSize', newPageSize)
}