Subscribe on changes!

组件被transition包裹,并且组件被transition的mode是out-in,组件第一行代码为注释会导致无法渲染dom / first line comment cause render error when component be wrapped with transition and transition mode="out-in"

avatar
Sep 27th 2021

Version

3.0.5

Reproduction link

sfc.vuejs.org/

Steps to reproduce

root组件:

else div
comp1:

修改active后无法显示div组件,mode="in-out"问题可解决

What is expected?

createCommentVNode不影响transition组件的正常渲染

What is actually happening?

当我在程序中添加一个功能后,部分页面无法加载,分析后,发现是transition的mode=“out-in”和createCommentVNode不兼容


the problem 这个问题可能在transition的mode= out-in mode="in-out"问题便不会复现

avatar
Sep 27th 2021

This is expected, you even have a warning in the console.


Please, next time consider using the forum, the Discord server or StackOverflow for questions first. But feel free to come back and open an issue if it turns out to be a bug 🙂

avatar
Sep 28th 2021

the warning is "Component inside renders non-element root node that cannot be animated.",but shouldn't be render error,only when transition has mode= out-in

avatar
Aug 10th 2022

很坑,找到了半天才找到这个帖子。我怎么都不会怀疑到我的注释上面,没想到就是注释惹的祸