-
-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Description
Version
3.0.0
Reproduction link
Please test this locally too, Codesandbox seems to not put out various Console Errors and loads some Components compared to an Local Environment.
https://codesandbox.io/s/vite-vue3-suspense-router-example-cwf00
Steps to reproduce
Steps to reproduce the Bugs:
- The Home Route wont automatically load (on local, works in codesandbox unfortunately)
1.1 On Local, the Home Route and Studio Route are not rendered<!---->. Just by clicking between the Routes multiple Times, the DOM eventually gets rendered
1.2 Clickbehavior like the following: Reload (no Home) -> Home -> Studio -> Home (now its rendered)
1.3 It is also possible to infinitely add<!---->to the DOM with that method - If App.vue doesnt have a
<div></div>within the default suspense template it will show the following console error:<Suspense>slots expect a single root node. - But if the default suspense template has a
<div></div>, vue router will add empty two<!---->into the dom, these do not exist if Point 2 is active - The First Children Routecomponent (Studio1) is not loaded either on route change but on page reload
4.1 Refreash the Page and click from home to studio and you wont see "studio1" headline - On local, studio 2 and studio 3 components have trouble loading with route change (but work on reload)
if the children router-view is not located within a "suspense" same as the app.vue router-view
All these Issues are just occuring since the latest Suspense Change (as far as tested):
#2099
What is expected?
Expected would be that a Route without any params would load on its specific Url, same goes for the Children Routes.
Also there shouldnt be empty dom comments <!----> rendered just by adding a empty div to the suspense default template.
What is actually happening?
Routes without Params are not showing their specific async Component on local enviroment.
Additional empty dom comments <!----> are getting rendered when using empty div tags in suspense default template together with a component slot from router-view
Tested on and with:
"@vue/compiler-sfc": "^3.0.0",
"vite": "^1.0.0-rc.4"
"vue": "^3.0.0",
"vue-router": "^4.0.0-beta.11"
Windows 10 64Bit,
Terminal: Integrated VSCode Terminal
Additional
Atm there is no Documentation about how to use suspense and router-view properly together.
There are old Bits out via Youtube Videos but this could lead to some confusion.
There should be an official Doc where its explained atleast