修复ts校验问题

This commit is contained in:
miaoxinyu01 2023-10-24 11:23:07 +08:00
parent 9832b3c286
commit 570d393b76

View File

@ -142,16 +142,13 @@ export class Pagination extends React.Component<
async handlePageNumChange(page: number, perPage?: number, dir?: string) {
const {disabled, onPageChange, dispatchEvent} = this.props;
await dispatchEvent?.('change', resolveEventData(this.props, {page}));
const _page = isNaN(Number(page)) || Number(page) < 1 ? 1 : page;
await dispatchEvent?.('change', resolveEventData(this.props, {_page}));
if (disabled) {
return;
}
onPageChange?.(
isNaN(Number(page)) || Number(page) < 1 ? 1 : page,
perPage,
dir
);
onPageChange?.(_page, perPage, dir);
}
/**