antfu avatar

Vue Router Best Practices

antfu/skills
4.1k

This skill provides best practices, patterns, and solutions for using Vue Router 4, focusing on navigation guards, route lifecycle management, and production setup. It covers common challenges such as handling route parameters, preventing infinite redirects, and cleaning up event listeners, making it ideal for Vue.js developers seeking to optimize navigation and routing in their applications. The comprehensive guidance helps ensure robust, efficient routing implementation in Vue projects.

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

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

Navigation Guards

Route Lifecycle

Setup

GitHub Owner

Owner: antfu

Files

router-beforeenter-no-param-trigger

router-beforerouteenter-no-this

router-guard-async-await-pattern

router-navigation-guard-infinite-loop

router-navigation-guard-next-deprecated

router-param-change-no-lifecycle

router-simple-routing-cleanup

router-use-vue-router-for-production

SKILL.md


name: vue-router-best-practices description: "Vue Router 4 patterns, navigation guards, route params, and route-component lifecycle interactions." version: 1.0.0 license: MIT author: github.com/vuejs-ai

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

Navigation Guards

Route Lifecycle

Setup

More skills