mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 21:55:11 +00:00
docs: mention use case for <KeepAlive>
in definePageMeta
(#8491)
This commit is contained in:
parent
d228b11c04
commit
5bc8c10a3b
@ -268,7 +268,9 @@ Of course, you are welcome to define metadata for your own use throughout your a
|
|||||||
|
|
||||||
#### `keepalive`
|
#### `keepalive`
|
||||||
|
|
||||||
Nuxt will automatically wrap your page in [the Vue `<KeepAlive>` component](https://vuejs.org/guide/built-ins/keep-alive.html#keepalive) if you set `keepalive: true` in your `definePageMeta`. This might be useful to do, for example, in a parent route that has dynamic child routes, if you want to preserve page state across route changes. You can also set props to be passed to `<KeepAlive>` (see a full list [here](https://vuejs.org/api/built-in-components.html#keepalive)).
|
Nuxt will automatically wrap your page in [the Vue `<KeepAlive>` component](https://vuejs.org/guide/built-ins/keep-alive.html#keepalive) if you set `keepalive: true` in your `definePageMeta`. This might be useful to do, for example, in a parent route that has dynamic child routes, if you want to preserve page state across route changes.
|
||||||
|
|
||||||
|
When your goal is to preserve state for parent routes use this syntax: `<NuxtPage keepalive />`. You can also set props to be passed to `<KeepAlive>` (see a full list [here](https://vuejs.org/api/built-in-components.html#keepalive)).
|
||||||
|
|
||||||
You can set a default value for this property [in your `nuxt.config`](/api/configuration/nuxt-config#keepalive).
|
You can set a default value for this property [in your `nuxt.config`](/api/configuration/nuxt-config#keepalive).
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user