使用router-view+keep-alive报错 TypeError: parentComponent.ctx.deactivate is not a function #9132
Answered
by
likui628
fshihu
asked this question in
Help/Questions
-
https://stackblitz.com/edit/vitejs-vite-xvrqvc?file=src%2Fmain.js |
Beta Was this translation helpful? Give feedback.
Answered by
likui628
Sep 5, 2023
Replies: 1 comment 1 reply
-
add <router-view v-slot="{ Component, route }">
<keep-alive>
<component
:is="Component"
v-if="route.meta.keepAlive"
:key="route.fullPath"
/>
</keep-alive>
<component :is="Component" v-if="!route.meta.keepAlive" />
</router-view> https://stackblitz.com/edit/vitejs-vite-s64hc9?file=src%2FApp.vue |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
fshihu
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
add
key
prophttps://stackblitz.com/edit/vitejs-vite-s64hc9?file=src%2FApp.vue