---
title: "Level 7: KeepAlive hides the child · Lifecycle Line-up · vuejs.school"
description: "Child sits inside <KeepAlive>. Hiding it deactivates it instead of unmounting. Two cards never fire."
canonical_url: "https://vuejs.school/games/lifecycle/7"
meta:
  "og:description": "Child sits inside <KeepAlive>. Hiding it deactivates it instead of unmounting. Two cards never fire."
  "og:image": "https://vuejs.school/_og/d/a_~S2VlcEFsaXZlIGhpZGVzIHRoZSBjaGlsZCDCtyB2dWVqcy5zY2hvb2w%2Cc_OgCard.takumi%2Ctitle_KeepAlive%2Bhides%2Bthe%2Bchild%2Cdescription_~Q2hpbGQgc2l0cyBpbnNpZGUgPEtlZXBBbGl2ZT4uIEhpZGluZyBpdCBkZWFjdGl2YXRlcyBpdCBpbnN0ZWFkIG9mIHVubW91bnRpbmcuIFR3byBjYXJkcyBuZXZlciBmaXJlLg%2Ceyebrow_~TGlmZWN5Y2xlIExpbmUtdXAgwrcgTGV2ZWwgNyBvZiA3%2Ctint_lilac%2Cp_Ii9nYW1lcy9saWZlY3ljbGUvNyI%2Cs_CThr9_a7lMY33mVZ.png"
  "og:image:alt": "KeepAlive hides the child · vuejs.school"
  "og:image:height": "600"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "Level 7: KeepAlive hides the child · Lifecycle Line-up · vuejs.school"
  "twitter:image": "https://vuejs.school/_og/d/a_~S2VlcEFsaXZlIGhpZGVzIHRoZSBjaGlsZCDCtyB2dWVqcy5zY2hvb2w%2Cc_OgCard.takumi%2Ctitle_KeepAlive%2Bhides%2Bthe%2Bchild%2Cdescription_~Q2hpbGQgc2l0cyBpbnNpZGUgPEtlZXBBbGl2ZT4uIEhpZGluZyBpdCBkZWFjdGl2YXRlcyBpdCBpbnN0ZWFkIG9mIHVubW91bnRpbmcuIFR3byBjYXJkcyBuZXZlciBmaXJlLg%2Ceyebrow_~TGlmZWN5Y2xlIExpbmUtdXAgwrcgTGV2ZWwgNyBvZiA3%2Ctint_lilac%2Cp_Ii9nYW1lcy9saWZlY3ljbGUvNyI%2Cs_CThr9_a7lMY33mVZ.png"
  "twitter:image:alt": "KeepAlive hides the child · vuejs.school"
---

> Index of every page on this site: [llms.txt](https://vuejs.school/llms.txt)

**Level 7 of 7 · onDeactivated instead of unmounting**

# **KeepAlive hides the child**

Child sits inside \<KeepAlive>. Hiding it deactivates it instead of unmounting. Two cards never fire.

**What happens**show is true. The learner clicks Hide, which sets show to false.

**App.vue **

**Child.vue **

```
<!-- App.vue -->
<KeepAlive>
  <Child v-if="show" />
</KeepAlive>
```

**Deck · tap a card to add it, or drag it into place**

-
-
-
-
-

**Timeline · first to last**

1. **1** Next card

**Game finished**

## **You finished Lifecycle Line-up**

All 7 levels done. Two more games are waiting for you.

- [**Preview****1****re-rendered****+1****Prediction game****Reactivity Radar**Will the template update? Call it before Vue does.0 of 3 levels done**Start playing**](https://vuejs.school/games/radar)
- [1\<template>2\<button@click="add">3 {{ count.value }}**bug**4\</button>5\</template>**Spot the bug****Bug Hunt**Find the broken line, then pick the fix.0 of 3 levels done**Start playing**](https://vuejs.school/games/bug-hunt)

[**All games**](https://vuejs.school/games) [**Play again from level 1**](https://vuejs.school/games/lifecycle/1)

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://vuejs.school/#website","@type":"WebSite","description":"A free AI-instructed school for Vue.js. Short tutorials, runnable code and quizzes that adapt to you.","name":"vuejs.school","url":"https://vuejs.school/","publisher":{"@id":"https://vuejs.school/#identity"}},{"@id":"https://vuejs.school/games/lifecycle/7#webpage","@type":"WebPage","description":"Child sits inside \u003CKeepAlive>. Hiding it deactivates it instead of unmounting. Two cards never fire.","name":"Level 7: KeepAlive hides the child · Lifecycle Line-up","url":"https://vuejs.school/games/lifecycle/7","isPartOf":{"@id":"https://vuejs.school/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://vuejs.school/games/lifecycle/7"]}],"primaryImageOfPage":{"@id":"https://vuejs.school/#logo"}},{"@id":"https://vuejs.school/#identity","@type":"Organization","description":"A free AI-instructed school for Vue.js. Short tutorials, runnable code and quizzes that adapt to you.","name":"vuejs.school","url":"https://vuejs.school","logo":{"@id":"https://vuejs.school/#logo"}},{"@id":"https://vuejs.school/#logo","@type":"ImageObject","caption":"vuejs.school","contentUrl":"https://vuejs.school/apple-touch-icon.png","inLanguage":"en","url":"https://vuejs.school/apple-touch-icon.png"}]}
```