Subscribe on changes!
avatar
Dec 21st 2021

Version

3.2.26

Reproduction link

SFC

Steps to reproduce

  1. open link
  2. Observe the animation happening only for loading

What is expected?

  1. transition worked with suspense default slot
  2. and the normal component

What is actually happening?

  1. transition only work with suspense fallback slot, not the default slot
  2. the normal component (not top await) loss transition animation
avatar
Dec 22nd 2021

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!

avatar
Dec 31st 2021

@posva if change the <style scoped> to <style> , it works fine. see https://codesandbox.io/s/white-river-3mf6q here is no scopedId image

avatar
Dec 31st 2021

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.

avatar
Jan 1st 2022

@posva I found something. Maybe this is not the right fix. Just a hint here.

  • currentScopeId is null when createVNode from TopLevelAwait.vue in RouterView. image

  • when suspense resolved, we will cloned it in _createVNode because Component is a VNode. So we losed the scopedId image

  • If we reassign the value to the scopeId when clone it will solve the problem. image

  • Here is a difference, in SFC Playground. It is not a VNode, so each time createVnode is called, the scopeId is assigned the value. image