修复ts校验问题

This commit is contained in:
miaoxinyu01 2023-10-24 11:50:34 +08:00
parent 570d393b76
commit 67f3fad1ce

View File

@ -250,13 +250,13 @@ export class Pagination extends React.Component<
const lastPage = this.getLastPage();
let value = e.currentTarget.value;
const {dispatchEvent} = this.props;
await dispatchEvent?.('change', resolveEventData(this.props, {value}));
if (/^\d+$/.test(value) && parseInt(value, 10) > lastPage) {
value = String(lastPage);
}
const {dispatchEvent} = this.props;
await dispatchEvent?.('change', resolveEventData(this.props, {value}));
this.setState({pageNum: value});
}