Vue Router guard/history experiment
This small app compares the browser's current URL and history position with
Vue Router's currentRoute while a real beforeResolve guard is pending.
Run it
From the repository root:
npm --prefix experiments/router-guard-history run dev
Open the URL printed by Vite.
Suggested tests
Forward navigation
- Enable Pause the next
beforeResolve. - Click Push Alpha.
- While paused, compare Browser URL with router.currentRoute.
- Allow or reject the navigation.
For router.push(), both values remain on the outgoing route until the guard
allows confirmation.
Back navigation
- Push Alpha, then push Beta.
- Enable Pause the next
beforeResolve. - Click Router Back.
- While paused, compare Browser URL with router.currentRoute.
- Reject the navigation and watch the browser restore its previous history entry, or repeat the test and allow it.
The event timeline separately records the raw browser popstate, Vue Router
guards, the URL, currentRoute, and the navigation result.