Nuxt typed router
Provide a type safe router to Nuxt with auto-generated typed definitions for route paths, names and params
- Autocompletes and typecheck routes paths, names and params
- Supports all programmatic navigation utils (
NuxtLink
,useRouter
,navigateTo
,useRoute
,useLocalePath
, etc...) - Supports optional params and catchAll routes
- Throw error if route path is invalid
- Out of the box
i18n
support - Supports routes extended by config and modules
Bash
$npm install nuxt-typed-router
Click to copy
Play on StackBlitz
Features
Type safety
Throws errors when route path/name/params doesn't match any page
0 config
Just plug the module and watch the magic!
Supports autoImport: false
I18n support
Out of the box support for prefixed i18n routes
Attentive
Watch changes in your router structure to automatically reload your types