What problem does it solve?
Many Vue Router apps suffer from subtle navigation issues: route-level guards not firing on param/query changes, beforeRouteEnter access misconceptions, unawaited async guards, infinite redirect loops, and stale component state when the same component is reused for different params. These problems lead to security gaps, broken UX, and hard-to-debug navigation failures in production.
Core Features & Use Cases
- Guard semantics & ordering: Clear explanations of when global, per-route, and in-component guards run and which patterns to use for entry vs update scenarios.
- Async and return-based patterns: Recommendations to await promises, return route objects to redirect, and replace deprecated next() usage to avoid hangs and double-calls.
- Lifecycle and param handling: Strategies for onBeforeRouteUpdate, watching route params, or using keys to force re-creation to prevent stale data.
- Debugging redirect loops & cleanup: Practical checks to avoid infinite redirects, add escape hatches, and ensure event listeners and handlers are cleaned up.
- Use Case: Securely enforce access checks for /orders/:id across both initial entry and intra-route param changes without causing redirects or stale UI.
Quick Start
Audit my router configuration for guard ordering, async handling, param-change updates, and potential redirect loops and provide prioritized fixes.