Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/victorgarciaesgi/nuxt-typed-router
🚦Provide autocompletion and typecheck to Nuxt router
https://github.com/victorgarciaesgi/nuxt-typed-router
nuxt nuxt-module nuxt-router nuxt-typescript nuxt3 nuxtjs typed-pages typed-router typedpages typescript vue vue-router vue-types
Last synced: about 1 month ago
JSON representation
🚦Provide autocompletion and typecheck to Nuxt router
- Host: GitHub
- URL: https://github.com/victorgarciaesgi/nuxt-typed-router
- Owner: victorgarciaesgi
- License: mit
- Created: 2020-01-08T14:03:01.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-01-15T14:32:41.000Z (10 months ago)
- Last Synced: 2024-01-30T13:11:07.386Z (10 months ago)
- Topics: nuxt, nuxt-module, nuxt-router, nuxt-typescript, nuxt3, nuxtjs, typed-pages, typed-router, typedpages, typescript, vue, vue-router, vue-types
- Language: TypeScript
- Homepage: https://nuxt-typed-router.vercel.app
- Size: 15.9 MB
- Stars: 307
- Watchers: 3
- Forks: 10
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
[npm-version-src]: https://img.shields.io/npm/v/nuxt-typed-router.svg
[npm-version-href]: https://www.npmjs.com/package/nuxt-typed-router
[npm-downloads-src]: https://img.shields.io/npm/dm/nuxt-typed-router.svg
[npm-total-downloads-src]: https://img.shields.io/npm/dt/nuxt-typed-router.svg
[npm-downloads-href]: https://www.npmjs.com/package/nuxt-typed-router[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![npm downloads][npm-total-downloads-src]][npm-downloads-href]## Provide a type safe router to Nuxt
- Supports all programmatic navigation utils (`NuxtLink`, `useRouter`, `navigateTo`, `useRoute`, `useLocalePath`, etc...)
- Supports optional params and catchAll routes
- Autocompletes routes paths, names and params
- Throw error if route path is invalid
- Out of the box `i18n` support
- Supports routes extended by config and modules
# Documentation
[![Documentation](https://github.com/victorgarciaesgi/nuxt-typed-router/blob/master/.github/images/redirectDoc.svg?raw=true)](https://nuxt-typed-router.vercel.app/)
# Play with it
[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/edit/github-7e4xvw?file=store/testRouter.ts)Demo repo 🧪 : [nuxt-typed-router-demo](https://github.com/victorgarciaesgi/nuxt-typed-router-demo)
## Cool video about it from LearnVue!
[![Watch the video](https://img.youtube.com/vi/jiYoAiFb71Y/default.jpg)](https://www.youtube.com/watch?v=jiYoAiFb71Y&t)
# Compatibility:
- Nuxt 3
# Quick start
### For Nuxt 3
```bash
npx nuxi@latest module add typed-router
```# Configuration
Register the module in the `nuxt.config.ts`, done!```ts
export default defineNuxtConfig({
modules: ['nuxt-typed-router'],
});
```## Development
1. Clone this repository
2. Install dependencies using `pnpm`
3. Build project for local tests `pnpm run test`
4. Start dev playground `pnpm run prepack && pnpm run dev`
5. Build project for deploy `pnpm prepack`## 📑 License
[MIT License](./LICENSE)