Vue router best practices
Vue Router 4 patterns, navigation guards, route params, and route-component lifecycle interactions.From its SKILL.md
npx -y skills add antfu/skills --skill vue-router-best-practicesAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
What its file declares
Copied from the file, not written here
The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
1.5 KB, 249 tokens by cl100k_base, as published. Nobody here has run it
Vue Router best practices, common gotchas, and navigation patterns.
Navigation Guards
- Navigating between same route with different params → See router-beforeenter-no-param-trigger
- Accessing component instance in beforeRouteEnter guard → See router-beforerouteenter-no-this
- Navigation guard making API calls without awaiting → See router-guard-async-await-pattern
- Users trapped in infinite redirect loops → See router-navigation-guard-infinite-loop
- Navigation guard using deprecated next() function → See router-navigation-guard-next-deprecated
Route Lifecycle
- Stale data when navigating between same route → See router-param-change-no-lifecycle
- Event listeners persisting after component unmounts → See router-simple-routing-cleanup
Setup
- Building production single-page application → See router-use-vue-router-for-production
What ships with it: 10 files
41.6 KB alongside SKILL.md
reference/
- router-beforeenter-no-param-trigger.md4.8 KB
- router-beforerouteenter-no-this.md4.9 KB
- router-guard-async-await-pattern.md5.8 KB
- router-navigation-guard-infinite-loop.md5.4 KB
- router-navigation-guard-next-deprecated.md4.2 KB
- router-param-change-no-lifecycle.md4.9 KB
- router-simple-routing-cleanup.md5.2 KB
- router-use-vue-router-for-production.md5.2 KB
- LICENSE.md1.1 KB
- SYNC.md161 B