fix(Table): illegal default current page is automatically fixed to 1

This commit is contained in:
xzdry 2022-09-14 11:36:16 +08:00
parent 58a58cffc5
commit 3b367d3b48

View File

@ -220,7 +220,7 @@ export const Table = implementRuntimeComponent({
const currentChecked = useRef<(string | number)[]>([]);
const [currentPage, setCurrentPage] = useStateValue<number>(
defaultCurrent ?? 1,
!defaultCurrent || defaultCurrent < 1 ? 1 : defaultCurrent,
mergeState,
updateWhenDefaultPageChanges,
'currentPage'