fix router page value inconsistent issue (#15742)

* fix router page value inconsistent issue

* make the fix more universal as suggested

* minor
This commit is contained in:
Sensor 2024-01-26 11:02:30 +08:00 committed by GitHub
parent 3e512249e3
commit 4e50a14d50
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 0 deletions

View File

@ -84,6 +84,7 @@ export interface Field<M> {
}
function toNumberOrUndefined(n: unknown): number | undefined {
if (n == null) return;
const r = Number(n);
return isNaN(r) ? undefined : r;
}