Skip to content
masterclass Buddy

Vue.js · Component

KeepAlive

KeepAlive caches inactive dynamic components so their state survives when users switch between views. It can filter cached components by name and limit the cache size.

Last updated

Syntax

<KeepAlive [include="pattern"] [exclude="pattern"] [max="count"]>
  <component :is="activeComponent" />
</KeepAlive>

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • component
  • Transition
  • activated
  • deactivated
  • mounted
  • unmounted

Source: KeepAlive | Vue.js. Checked 2026-11-03.