You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
New setting for preserving page component instances (and thus their
state) across client-side navigation, by wrapping the <Page> component
with Vue's built-in <KeepAlive> component.
Wrapping <slot/> with <KeepAlive> inside a +Layout component cannot
work: <KeepAlive> only caches its direct child component, whereas slot
content is rendered as a Fragment which <KeepAlive> cannot cache. Thus
vike-vue applies <KeepAlive> where it works: directly around the routed
<Page> component.
Usage:
// pages/+config.ts
export default {
keepAlive: true, // or KeepAliveProps, e.g. { max: 10 }
}
See https://github.com/orgs/vikejs/discussions/3433
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MU13ncNmLi5rz2xySmm5rZ
* Whether to wrap the `<Page>` component with Vue's built-in [`<KeepAlive>`](https://vuejs.org/guide/built-ins/keep-alive.html) component, preserving page component instances (and thus their state) across client-side navigation.
30
+
*
31
+
* Instead of `true`, you can provide `<KeepAlive>` props (e.g. `{ include, exclude, max }`) for controlling which page components are cached.
0 commit comments