vue-router

Installation
SKILL.md

When to use this skill

Use this skill whenever the user wants to:

  • 在 Vue 项目中配置路由、动态路由、守卫与懒加载
  • 使用 Vue Router 4(Vue 3)或 3.x(Vue 2)API

How to use this skill

  1. 配置:createRouter、routes、history 模式;router-link、router-view、useRouter。
  2. 进阶:动态路由、嵌套路由、beforeEach 守卫、meta;懒加载 component: () => import()。
  3. 参考https://router.vuejs.org/

Best Practices

  • 路由与权限在守卫中集中处理;大页面懒加载。
  • 命名路由与 params/query 规范;避免在路由中存敏感数据。

Keywords

Installs
46
GitHub Stars
2
First Seen
Jun 6, 2026
vue-router — full-statck-skills/vue-skills