File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
src/guide/built-ins/keep-alive-demos Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -4,20 +4,20 @@ import CompB from './CompB.vue'
4
4
5
5
let current = $shallowRef (CompA)
6
6
7
- const { useKeepAlive } = defineProps ([ ' useKeepAlive' ] )
7
+ const { useKeepAlive } = defineProps ({ useKeepAlive: Boolean } )
8
8
</script >
9
9
10
10
<template >
11
11
<div class =" demo" >
12
12
<label ><input type =" radio" v-model =" current" :value =" CompA" /> A</label >
13
13
<label ><input type =" radio" v-model =" current" :value =" CompB" /> B</label >
14
14
<template v-if =" useKeepAlive " >
15
- <component :is =" current" ></component >
16
- </template >
17
- <template v-else >
18
15
<KeepAlive >
19
16
<component :is =" current" ></component >
20
17
</KeepAlive >
21
18
</template >
19
+ <template v-else >
20
+ <component :is =" current" ></component >
21
+ </template >
22
22
</div >
23
23
</template >
You can’t perform that action at this time.
0 commit comments