3.0.0-rc.12
https://jsfiddle.net/vmprxysu/
Consider a component like the following:
<Suspense>
<template #fallback>Loading...</template>
<router-view />
</Suspense>
with a router config loading an async component
In rc.10, we see the loading indicator and then the async component is displayed
In rc.12 nothing is displayed. Is this expected with the recent changes or is it a regression?
Probably related to the rendered component being nested. The component is displayed if the v-slot api is used
You mean if we use <hello /> directly instead of <router-view />? If so, yes it does work. But as it was nice to be able to use Suspense around the RouterView to handle the async loading, I thought it was worth opening an issue.
I have the same issue
Similar to <transition>, the new Suspense now must be used with <router-view> via its slot-based syntax because it now must have direct access to the toggled root node:
<router-view v-slot="{ Component }">
<suspense>
<component :is="Component"/>
</suspense>
</router-view>
Similar to
<transition>, the new Suspense now must be used with<router-view>via its slot-based syntax because it now must have direct access to the toggled root node:<router-view v-slot="{ Component }"> <suspense> <component :is="Component"/> </suspense> </router-view>
[Vue warn]: <Suspense> slots expect a single root node.
Similar to
<transition>, the new Suspense now must be used with<router-view>via its slot-based syntax because it now must have direct access to the toggled root node:<router-view v-slot="{ Component }"> <suspense> <component :is="Component"/> </suspense> </router-view>
[Vue warn]: <Suspense> slots expect a single root node.
Fixed:
<router-view v-slot="{ Component }">
<suspense>
<div>
<component :is="Component" />
</div>
</suspense>
</router-view>