SuperAPI AI Directory

vue-router

Frontend & websites

View repository

Updated 10-15 15:38

About this skill

When to use this skill

Use this skill whenever the user wants to:

  • Configure routing, dynamic routes, guards, and lazy loading in a Vue project
  • Use the Vue Router 4 (Vue 3) or 3.x (Vue 2) API

How to use this skill

  1. Configuration: createRouter, routes, history mode; router-link, router-view, useRouter.
  2. Advanced: dynamic routes, nested routes, beforeEach guards, meta; lazy loading component: () => import().
  3. Reference:https://router.vuejs.org/

Best Practices

  • Handle routing and permissions centrally in guards; lazy-load large pages.
  • Conventions for named routes and params/query; avoid storing sensitive data in routes.

Keywords

vue router, routing, guards, Vue 3, Vue 2