mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-21 21:25:11 +00:00
docs: clarify navigateTo is not for nitro routes (#28092)
This commit is contained in:
parent
4ea89318df
commit
8f7815e96e
@ -8,7 +8,7 @@ links:
|
||||
size: xs
|
||||
---
|
||||
|
||||
`useNuxtApp` is a built-in composable that provides a way to access shared runtime context of Nuxt, also known as the [Nuxt context](/docs/guide/going-further/nuxt-app#the-nuxt-context), which is available on both client and server side. It helps you access the Vue app instance, runtime hooks, runtime config variables and internal states, such as `ssrContext` and `payload`.
|
||||
`useNuxtApp` is a built-in composable that provides a way to access shared runtime context of Nuxt, also known as the [Nuxt context](/docs/guide/going-further/nuxt-app#the-nuxt-context), which is available on both client and server side (but not within Nitro routes). It helps you access the Vue app instance, runtime hooks, runtime config variables and internal states, such as `ssrContext` and `payload`.
|
||||
|
||||
```vue [app.vue]
|
||||
<script setup lang="ts">
|
||||
|
@ -9,13 +9,17 @@ links:
|
||||
---
|
||||
|
||||
::note
|
||||
`navigateTo` is available on both server side and client side.
|
||||
`navigateTo` is available on both client and server side (but not within Nitro routes).
|
||||
::
|
||||
|
||||
## Usage
|
||||
|
||||
`navigateTo` is available on both server side and client side. It can be used within the [Nuxt context](/docs/guide/going-further/nuxt-app#the-nuxt-context), or directly, to perform page navigation.
|
||||
|
||||
::tip
|
||||
To send a redirect from a server endpoint, use [`sendRedirect`](https://h3.unjs.io/utils/response#sendredirectevent-location-code) instead.
|
||||
::
|
||||
|
||||
### Within a Vue Component
|
||||
|
||||
```vue
|
||||
|
Loading…
Reference in New Issue
Block a user