vue-router-best-practices
Vue Router 4 patterns, navigation guards, route params, and route-component lifecycle interactions.
- License 许可
- MIT
- 最近更新
- 2026-07-17
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- vue-router-best-practices
- author
- github.com/vuejs-ai
- license
- MIT
- version
- 1.0.0
- description
- Vue Router 4 patterns, navigation guards, route params, and route-component lifecycle interactions.
02 资源文件 10
- 许可证LICENSE.md1.1 KB
- 参考文档reference/router-beforeenter-no-param-trigger.md4.8 KB
- 参考文档reference/router-beforerouteenter-no-this.md4.9 KB
- 参考文档reference/router-guard-async-await-pattern.md5.8 KB
- 参考文档reference/router-navigation-guard-infinite-loop.md5.4 KB
- 参考文档reference/router-navigation-guard-next-deprecated.md4.2 KB
- 参考文档reference/router-param-change-no-lifecycle.md4.9 KB
- 参考文档reference/router-simple-routing-cleanup.md5.2 KB
- 参考文档reference/router-use-vue-router-for-production.md5.2 KB
- 参考文档SYNC.md161 B
03 SKILL.md 正文
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
04 同仓库更多 Skills
webapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
web-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use for complex artifacts requiring state management, routing, or shadcn/ui components - not for simple single-file HTML/JSX artifacts.
vueuse-functions
Apply VueUse composables where appropriate to build concise, maintainable Vue.js / Nuxt features.
vue-testing-best-practices
Use for Vue.js testing. Covers Vitest, Vue Test Utils, component testing, mocking, testing patterns, and Playwright for E2E testing.
vue-best-practices
MUST be used for Vue.js tasks. Strongly recommends Composition API with `<script setup>` and TypeScript as the standard approach. Covers Vue 3, SSR, Volar, vue-tsc. Load for any Vue, .vue files, Vue Router, Pinia, or Vite with Vue work. ALWAYS use Composition API unless the project explicitly requires Options API.
vss-summarize-video
Use to summarize a recorded video via the LVS summarization microservice (HITL-gated) with a VLM fallback. Not for report generation or live RTSP captioning.