Built-in Components

Caches dynamically toggled components wrapped
inside.

When wrapped around a dynamic component,
<KeepAlive> caches the inactive component
instances without destroying them.

There can only be one active component instance
as the direct child of at any time.

<KeepAlive>
  <component :is="view"></component>
</KeepAlive>

<KeepAlive>
  <comp-a v-if="a > 1"></comp-a>
  <comp-b v-else></comp-b>
</KeepAlive>

<Transition>
  <KeepAlive>
    <component :is="view"></component>
  </KeepAlive>
</Transition>