| 1 | # Configure Routes |
| 2 | |
| 3 | <Environment type="client" /> |
| 4 | |
| 5 | Add custom pages to the Slidev app. |
| 6 | |
| 7 | ## Usage |
| 8 | |
| 9 | Create `./setup/routes.ts` with the following content: |
| 10 | |
| 11 | ```ts twoslash [./setup/routes.ts] |
| 12 | import { defineRoutesSetup } from '@slidev/types' |
| 13 | |
| 14 | export default defineRoutesSetup((routes) => { |
| 15 | return [ |
| 16 | ...routes, |
| 17 | { |
| 18 | path: '/my-page', |
| 19 | // ---cut-start--- |
| 20 | // @ts-expect-error missing types |
| 21 | // ---cut-end--- |
| 22 | component: () => import('../pages/my-page.vue'), |
| 23 | }, |
| 24 | ] |
| 25 | }) |
| 26 | ``` |
| 27 | |
| 28 | Learn more about routes in the [Vue Router documentation](https://router.vuejs.org/). |
| 29 |