Agent skill

vue-router-best-practices

Vue Router 4 patterns, navigation guards, route params, and route-component lifecycle interactions.

Stars 4,427
Forks 225

Install this agent skill to your Project

npx add-skill https://github.com/antfu/skills/tree/main/skills/vue-router-best-practices

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

Expand your agent's capabilities with these related and highly-rated skills.

antfu/skills

pnpm

Node.js package manager with strict dependency resolution. Use when running pnpm specific commands, configuring workspaces, or managing dependencies with catalogs, patches, or overrides.

4,427 225
Explore
antfu/skills

vue

Vue 3 Composition API, script setup macros, reactivity system, and built-in components. Use when writing Vue SFCs, defineProps/defineEmits/defineModel, watchers, or using Transition/Teleport/Suspense/KeepAlive.

4,427 225
Explore
antfu/skills

vite

Vite build tool configuration, plugin API, SSR, and Vite 8 Rolldown migration. Use when working with Vite projects, vite.config.ts, Vite plugins, or building libraries/SSR apps with Vite.

4,427 225
Explore
antfu/skills

slidev

Create and present web-based slidedecks for developers using Slidev with Markdown, Vue components, code highlighting, animations, and interactive features. Use when building technical presentations, conference talks, code walkthroughs, teaching materials, or developer decks.

4,427 225
Explore
antfu/skills

vitest

Vitest fast unit testing framework powered by Vite with Jest-compatible API. Use when writing tests, mocking, configuring coverage, or working with test filtering and fixtures.

4,427 225
Explore
antfu/skills

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.

4,427 225
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results