Skip to content
Source
Sign inSign up
TanStack/query
Open History to see the last commit

router.ts

21 lines563 Bytes

1import { h } from 'vue'
2import { createRouter } from '@tanstack/vue-router'
3import ErrorPage from './ErrorPage.vue'
4import { queryClient } from './queryClient'
5import { routeTree } from './routeTree.gen'
6​
7export const router = createRouter({
8 routeTree,
9 context: { queryClient },
10 defaultPreload: 'intent',
11 defaultPreloadStaleTime: 0,
12 defaultErrorComponent: ErrorPage,
13 defaultNotFoundComponent: () =>
14 h(ErrorPage, { error: new Error('Not Found') }),
15})
16​
17declare module '@tanstack/vue-router' {
18 interface Register {
19 router: typeof router
20 }