packages/vue-router/README.md
π€ Type-safe router w/ built-in caching & URL state management for Vue!
<a href="https://twitter.com/intent/tweet?button_hashtag=TanStack" target="\_parent"></a><a href="https://discord.com/invite/WrRKjPJ" target="\_parent">
</a><a href="https://npmjs.com/package/@tanstack/vue-router" target="\_parent">
</a><a href="https://bundlephobia.com/result?p=@tanstack/vue-router" target="\_parent">
</a><a href="#badge">
</a><a href="https://github.com/TanStack/router/discussions">
</a><a href="https://bestofjs.org/projects/router"></a><a href="https://github.com/TanStack/router" target="\_parent">
</a><a href="https://twitter.com/tan_stack" target="\_parent">
</a><a href="https://twitter.com/tannerlinsley" target="\_parent">
</a>| Suffix/Pattern | Purpose |
|---|---|
.route.ts | Route configuration (loader, validateSearch, head, etc.) |
.component.vue | The component rendered for the route |
.errorComponent.vue | Error boundary component for the route |
.notFoundComponent.vue | Not found component for the route |
.lazy.ts | Lazy-loaded route configuration |
_layout prefix | Layout routes that wrap child routes |
_ suffix (e.g., posts_.$postId) | Unnested routes (break out of parent layout) |
(groupName) directory | Route groups (organizational, don't affect URL) |
$param | Dynamic route parameters |
src/routes/
βββ __root.ts # Root route config
βββ __root.component.vue # Root layout component
βββ __root.notFoundComponent.vue # Global not found component
βββ index.route.ts # "/" route config
βββ index.component.vue # "/" component
βββ posts.route.ts # "/posts" route config
βββ posts.component.vue # "/posts" layout component
βββ posts.index.component.vue # "/posts" index component
βββ posts.$postId.route.ts # "/posts/:postId" route config
βββ posts.$postId.component.vue # "/posts/:postId" component
βββ posts.$postId.errorComponent.vue # Error boundary for post
βββ posts_.$postId.edit.route.ts # "/posts/:postId/edit" (unnested)
βββ (group)/ # Route group (no URL impact)
β βββ _layout.route.ts # Layout for group
β βββ _layout.component.vue
β βββ inside.component.vue # "/inside"
βββ λνλ―Όκ΅.component.vue # Unicode routes supported