Fix validation guard for router (#520)

This commit is contained in:
Fine0830
2026-02-05 18:01:05 +08:00
committed by GitHub
parent 41b323400f
commit 4e3b1bdeae
4 changed files with 8 additions and 18 deletions

View File

@@ -55,9 +55,7 @@ export function createValidationGuard() {
// Validate route parameters if needed
if (to.params && Object.keys(to.params).length > 0) {
// Add custom validation logic here
const hasValidParams = Object.values(to.params).every(
(param) => param !== undefined && param !== null && param !== "",
);
const hasValidParams = Object.values(to.params).every((param) => param !== undefined);
if (!hasValidParams) {
next({ name: "NotFound" });