-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Suspense doesn't work with keepAlive #3652
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This link explains how these components work together, their order is very important https://v3.vuejs.org/guide/migration/suspense.html#combining-with-other-components, but unfortunately, there are still bugs here |
I'm no vue internals expert, but I ran into the same error when using suspense, and it seems to be caused by |
you can try to add attribute |
Update: https://vuejs.org/guide/built-ins/suspense.html#combining-with-other-components |
This one is working when using the correct order: <router-view v-slot="{ Component, route }">
<template v-if="Component">
<KeepAlive>
<Suspense>
<!-- main content -->
<component :key="route.path" :is="Component"></component>
<!-- loading state -->
<template #fallback>
Loading...
</template>
</Suspense>
</KeepAlive>
</template>
</router-view> |
Version
3.0.11
Reproduction link
https://codesandbox.io/s/hidden-flower-y164t?file=/src/App.vue
Steps to reproduce
add count
to about page
TypeError Cannot read property 'parentNode' of null
What is expected?
keep alive works
What is actually happening?
it doesn't work
The text was updated successfully, but these errors were encountered: