Skip to content

Commit 50c3d8c

Browse files
fix keep-alive examples (vuejs#1444)
1 parent dbcac4d commit 50c3d8c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/guide/built-ins/keep-alive-demos/SwitchComponent.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@ import CompB from './CompB.vue'
44
55
let current = $shallowRef(CompA)
66
7-
const { useKeepAlive } = defineProps(['useKeepAlive'])
7+
const { useKeepAlive } = defineProps({ useKeepAlive: Boolean })
88
</script>
99

1010
<template>
1111
<div class="demo">
1212
<label><input type="radio" v-model="current" :value="CompA" /> A</label>
1313
<label><input type="radio" v-model="current" :value="CompB" /> B</label>
1414
<template v-if="useKeepAlive">
15-
<component :is="current"></component>
16-
</template>
17-
<template v-else>
1815
<KeepAlive>
1916
<component :is="current"></component>
2017
</KeepAlive>
2118
</template>
19+
<template v-else>
20+
<component :is="current"></component>
21+
</template>
2222
</div>
2323
</template>

0 commit comments

Comments
 (0)