{{ post.title }}
{{ post.body }}
User: {{ route.params.id }}
isLoading: {{ isLoading }}
Error: {{ error }}
{{ user == null ? String(user) : user }}
User: {{ route.params.id }}
status: {{ status }}
isLoading: {{ isLoading }}
Error: {{ error }}
{{ user == null ? String(user) : user }}
{{ post.body }}
{{ post.body }}
Loading...
{{ error.message }}
{{ user }}
{{ error.message }}
``` If you want to be even stricter, you can override the default `Error` type with `unknown` (or anything else) by augmenting the `TypesConfig` interface. ```ts // types-extension.d.ts import 'vue-router' export {} declare module 'vue-router' { interface TypesConfig { Error: unknown } } ``` --- --- url: /file-based-routing/eslint.md --- # ESLint If you are not using auto imports, you will need to tell ESLint about `vue-router/auto-routes`. Add these lines to your eslint configuration: ```json{3} { "settings": { "import/core-modules": ["vue-router/auto-routes"] } } ``` ## `definePage()` Since `definePage()` is a global macro, you need to tell ESLint about it. Add these lines to your eslint configuration: ```json{3} { "globals": { "definePage": "readonly" } } ``` --- --- url: /experimental/router-resolver.md --- # Experimental Router ::: warning The experimental router reflects the explorations of the upcoming major version of Vue Router. It is not production-ready and should be used for testing and feedback purposes only. ::: The experimental router introduces a new **resolver-based** matching layer that powers stronger typing, file-based routing, and **custom param parsers**. ## Installation The experimental router lives next to the stable one and is opt-in. You import the factory from `vue-router/experimental` and a resolver (from `vue-router/auto-resolver` when using file-based routing): ```ts{3,4,8} // src/router/index.ts import { createWebHistory } from 'vue-router' import { experimental_createRouter as createRouter } from 'vue-router/experimental' import { resolver, handleHotUpdate } from 'vue-router/auto-resolver' export const router = createRouter({ history: createWebHistory(), resolver, }) if (import.meta.hot) { handleHotUpdate(router) } ``` Since the experimental router doesn't add the `In Vue Router 3, I render inside the route component
In Vue Router 3, I render inside the route component
Some slotted content