option
HomeHome Skill Web Development vue-router-best-practices

vue-router-best-practices

antfu/skills antfu/skills

Provides best practices for Vue Router 4, including navigation guards, route params, and route-component lifecycle interactions.

...Expand all
14
Updated time September 8, 2026

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
View on GitHub
---
name: vue-router-best-practices
description: Provides best practices for Vue Router 4, including navigation guards, route params, and route-component lifecycle interactions.
license: MIT
---

Vue Router best practices, common gotchas, and navigation patterns.

### Navigation Guards
- Navigating between same route with different params → See [router-beforeenter-no-param-trigger](reference/router-beforeenter-no-param-trigger.md)
- Accessing component instance in beforeRouteEnter guard → See [router-beforerouteenter-no-this](reference/router-beforerouteenter-no-this.md)
- Navigation guard making API calls without awaiting → See [router-guard-async-await-pattern](reference/router-guard-async-await-pattern.md)
- Users trapped in infinite redirect loops → See [router-navigation-guard-infinite-loop](reference/router-navigation-guard-infinite-loop.md)
- Navigation guard using deprecated next() function → See [router-navigation-guard-next-deprecated](reference/router-navigation-guard-next-deprecated.md)

### Route Lifecycle
- Stale data when navigating between same route → See [router-param-change-no-lifecycle](reference/router-param-change-no-lifecycle.md)
- Event listeners persisting after component unmounts → See [router-simple-routing-cleanup](reference/router-simple-routing-cleanup.md)

### Setup
- Building production single-page application → See [router-use-vue-router-for-production](reference/router-use-vue-router-for-production.md)

All Files

0 files

Install vue-router-best-practices

Download and extract the skill files to your .claude/skills/ directory.

Download ZIP

Clone the repository and copy the skill files to your project.

git clone https://github.com/antfu/skills/tree/main/skills/vue-router-best-practices # Copy SKILL.md to your .claude/skills/ directory

Copy Copy
Quick Setup: Copy the skill folder to .claude/skills/ Claude will automatically detect and use the skill
Repository antfu/skills

Related Skills

github-code-search
Updated time June 29, 2026
drizzle-orm
Updated time June 29, 2026
clickhouse-io
Updated time June 29, 2026
prisma-client-api
Updated time June 29, 2026
OR