Skip to content

Commit 4488f2c

Browse files
rchlSébastien Chopin
authored and
Sébastien Chopin
committed
fix: correct context.app type per (#5662) (nuxt#1384)
Adjust documentation to match PR #5701
1 parent 38aaf2d commit 4488f2c

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

en/api/context.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ description: The `context` provides additional objects/params from Nuxt not trad
1010
## Available keys
1111

1212
<div class="Alert Alert--teal">
13-
13+
1414
**Note:** This is **not** the context passed into the `build.extend` function.
1515

1616
</div>
@@ -20,21 +20,21 @@ List of all the available keys in `context`:
2020

2121
| Key | Type | Available | Description |
2222
|------------------------|------------------------------------------------------------------------------------|-----------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
23-
| `app` | Root Vue Instance | Client & Server | The root Vue instance options that includes all your plugins. For example, when using `axios`, you can get access to `$axios` through `context.app.$axios`. |
24-
| `isClient` | `Boolean` | Client & Server | **Deprecated!** Use `process.client`. Boolean to let you know if you're actually renderer from the client-side. |
25-
| `isServer` | `Boolean` | Client & Server | **Deprecated!** Use `process.server`. Boolean to let you know if you're actually renderer from the server-side. |
26-
| `isStatic` | `Boolean` | Client & Server | **Deprecated!** Use `process.static`. Boolean to let you know if you're actually inside a generated app (via `nuxt generate`). |
23+
| `app` | `NuxtAppOptions` | Client & Server | The root Vue instance options that includes all your plugins. For example, when using `axios`, you can get access to `$axios` through `context.app.$axios`. |
24+
| `isClient` | `Boolean` | Client & Server | **Deprecated!** Use `process.client`. Boolean to let you know if you're actually renderer from the client-side. |
25+
| `isServer` | `Boolean` | Client & Server | **Deprecated!** Use `process.server`. Boolean to let you know if you're actually renderer from the server-side. |
26+
| `isStatic` | `Boolean` | Client & Server | **Deprecated!** Use `process.static`. Boolean to let you know if you're actually inside a generated app (via `nuxt generate`). |
2727
| `isDev` | `Boolean` | Client & Server | Boolean to let you know if you're in dev mode, can be useful for caching some data in production. |
2828
| `isHMR` | `Boolean` | Client & Server | Boolean to let you know if the method/middleware is called from webpack hot module replacement (*only on client-side in dev mode*). |
2929
| `route` | [Vue Router Route](https://router.vuejs.org/en/api/route-object.html) | Client & Server | Vue Router route instance. |
30-
| `from` | [Vue Router Route](https://router.vuejs.org/en/api/route-object.html) | Client | The route navigated from
30+
| `from` | [Vue Router Route](https://router.vuejs.org/en/api/route-object.html) | Client | The route navigated from |
3131
| `store` | [Vuex Store](https://vuex.vuejs.org/en/api.html#vuexstore-instance-properties) | Client & Server | Vuex Store instance. **Available only if the [vuex store](/guide/vuex-store) is set**. |
3232
| `env` | `Object` | Client & Server | Environment variables set in `nuxt.config.js`, see [env api](/api/configuration-env). |
33-
| `params` | `Object` | Client & Server | Alias of `route.params`. |
33+
| `params` | `Object` | Client & Server | Alias of `route.params`. |
3434
| `query` | `Object` | Client & Server | Alias of `route.query`. |
35-
| `req` | [`http.Request`](https://nodejs.org/api/http.html#http_class_http_incomingmessage) | Server | Request from the Node.js server. If Nuxt is used as a middleware, the request object might be different depending on the framework you're using.<br>**Not available via `nuxt generate`**. |
35+
| `req` | [`http.Request`](https://nodejs.org/api/http.html#http_class_http_incomingmessage) | Server | Request from the Node.js server. If Nuxt is used as a middleware, the request object might be different depending on the framework you're using.<br>**Not available via `nuxt generate`**. |
3636
| `res` | [`http.Response`](https://nodejs.org/api/http.html#http_class_http_serverresponse) | Server | Response from the Node.js server. If Nuxt is used as a middleware, the res object might be different depending on the framework you're using.<br>**Not available via `nuxt generate`**. |
37-
| `redirect` | `Function` | Client & Server | Use this method to redirect the user to another route, the status code is used on the server-side, defaults to `302`. `redirect([status,] path [, query])`. |
37+
| `redirect` | `Function` | Client & Server | Use this method to redirect the user to another route, the status code is used on the server-side, defaults to `302`. `redirect([status,] path [, query])`. |
3838
| `error` | `Function` | Client & Server | Use this method to show the error page: `error(params)`. The `params` should have the properties `statusCode` and `message`. |
3939
| `nuxtState` | `Object` | Client | Nuxt state, useful for plugins which uses `beforeNuxtRender` to get the nuxt state on client-side before hydration. **Available only in `universal` mode**. |
4040
| `beforeNuxtRender(fn)` | `Function` | Server | Use this method to update `__NUXT__` variable rendered on client-side, the `fn` (can be asynchronous) is called with `{ Components, nuxtState }`, see [example](https://github.com/nuxt/nuxt.js/blob/cf6b0df45f678c5ac35535d49710c606ab34787d/test/fixtures/basic/pages/special-state.vue). |

0 commit comments

Comments
 (0)