home / skills / partme-ai / full-stack-skills / vue-router
This skill helps you configure Vue Router effectively, manage navigation, guards, and dynamic routes with best practices and clear guidance.
npx playbooks add skill partme-ai/full-stack-skills --skill vue-routerReview the files below or copy the command above to add this skill to your agents.
---
name: vue-router
description: Provides comprehensive guidance for Vue Router including route configuration, navigation, dynamic routes, nested routes, route guards, programmatic navigation, and route meta. Use when the user asks about Vue Router, needs to set up routing, implement navigation guards, handle route parameters, or manage route transitions.
license: Complete terms in LICENSE.txt
---
## When to use this skill
Use this skill whenever the user wants to:
- [待完善:根据具体工具添加使用场景]
## How to use this skill
[待完善:根据具体工具添加使用指南]
## Best Practices
[待完善:根据具体工具添加最佳实践]
## Keywords
[待完善:根据具体工具添加关键词]
This skill provides comprehensive guidance for using Vue Router in Vue.js applications, covering route configuration, dynamic and nested routes, navigation guards, programmatic navigation, and route meta fields. It focuses on practical patterns and examples that help you set up routing, protect routes, and manage transitions in single-page applications. Use it to design predictable navigation behavior and handle common routing scenarios efficiently.
The skill inspects common routing needs and explains how to declare routes, use router instances, and integrate router-link and router-view in components. It explains dynamic route parameters, nested child routes, named views, and lazy-loaded routes for performance. It also covers route guards (global, per-route, and in-component), programmatic navigation with router.push/replace, and using route meta to store authorization or transition info.
How do I pass route params as props to a component?
Enable props in the route definition (props: true) or use a function to map params to props for validation or transformation.
Where should I put authentication logic for routes?
Put global checks in router.beforeEach for central control; use per-route guards for exceptions and in-component guards for UI-level transitions.