Suspended component + transition
Version
3.2.26
Reproduction link
Steps to reproduce
- open link
- Observe the animation happening only for loading
What is expected?
- transition worked with suspense default slot
- and the normal component
What is actually happening?
- transition only work with
suspense fallback slot
, not thedefault slot
- the normal component (not top await) loss transition animation
Still unsure of why this is happening only with the router. I tried creating a version replicating what the router does but I still couldn't find it. I also noticed, the problem appears with flat routes too.
Any help on this one is welcome!
@posva
if change the <style scoped>
to <style>
, it works fine. see https://codesandbox.io/s/white-river-3mf6q
here is no scopedId
Thanks @edison1105
Still works on SFC Playground 🤔 I think I got confused between working or not working, it does not work without vue router indeed and removing scoped seems to be a workaround.
@posva I found something. Maybe this is not the right fix. Just a hint here.
currentScopeId
is null whencreateVNode
fromTopLevelAwait.vue
inRouterView
.when suspense resolved, we will cloned it in
_createVNode
becauseComponent
is a VNode. So we losed thescopedId
If we reassign the value to the scopeId when clone it will solve the problem.
Here is a difference, in SFC Playground. It is not a VNode, so each time
createVnode
is called, thescopeId
is assigned the value.