fix: 恢复表格分页大小 localStorage 持久化

- usePersistedPageSize: 恢复 localStorage 读写,以系统配置为 fallback
- useTableLoader: handlePageSizeChange 时写入 localStorage
- Pagination.vue: handlePageSizeChange 时写入 localStorage

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
DaydreamCoding
2026-04-16 21:23:19 +08:00
committed by QTom
parent 8ad099baa6
commit f084d30d65
3 changed files with 28 additions and 5 deletions

View File

@@ -1,7 +1,7 @@
import { ref, reactive, onUnmounted, toRaw } from 'vue'
import { useDebounceFn } from '@vueuse/core'
import type { BasePaginationResponse, FetchOptions } from '@/types'
import { getPersistedPageSize } from './usePersistedPageSize'
import { getPersistedPageSize, setPersistedPageSize } from './usePersistedPageSize'
interface PaginationState {
page: number
@@ -88,6 +88,7 @@ export function useTableLoader<T, P extends Record<string, any>>(options: TableL
const handlePageSizeChange = (size: number) => {
pagination.page_size = size
pagination.page = 1
setPersistedPageSize(size)
load()
}