Skip to content

Configure Routes

Environment: client
This setup function will only run on client side. Make sure the browser compatibility when importing packages.

Add your pages to the Slidev app.

Usage

Create ./setup/routes.ts with the following content:

ts
import { defineRoutesSetup } from '@slidev/types'

export default defineRoutesSetup((routes) => {
  return [
    ...routes,
    {
      path: '/my-page',
      component: () => import('../pages/my-page.vue'),
    },
  ]
})

Learn more about routes in the Vue Router documentation.

Released under the MIT License.