mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 15:15:19 +00:00
f26a801775
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Daniel Roe <daniel@roe.dev>
23 lines
606 B
Markdown
23 lines
606 B
Markdown
---
|
|
title: 'prerenderRoutes'
|
|
description: prerenderRoutes hints to Nitro to prerender an additional route.
|
|
links:
|
|
- label: Source
|
|
icon: i-simple-icons-github
|
|
to: https://github.com/nuxt/nuxt/blob/main/packages/nuxt/src/app/composables/ssr.ts
|
|
size: xs
|
|
---
|
|
|
|
When prerendering, you can hint to Nitro to prerender additional paths, even if their URLs do not show up in the HTML of the generated page.
|
|
|
|
```js
|
|
const route = useRoute()
|
|
|
|
prerenderRoutes('/')
|
|
prerenderRoutes(['/', '/about'])
|
|
```
|
|
|
|
::callout
|
|
In the browser, or if called outside prerendering, `prerenderRoutes` will have no effect.
|
|
::
|