编程语言
首页 > 编程语言> > vue ssr报错:Error while initializing app DOMException: Failed to execute ‘appendChild‘ on ‘Node‘: This

vue ssr报错:Error while initializing app DOMException: Failed to execute ‘appendChild‘ on ‘Node‘: This

作者:互联网

Error while initializing app DOMException: Failed to execute 'appendChild' on 'Node': This node type does not support this method. at Object.We [as appendChild]

起因是:
1、封装了一个自定义loading组件,在组件内部使用v-show="show"来控制显示隐藏
2、通过props传入show来控制
3、使用vue-server-renderer构造的服务端渲染
4、在纯vue项目中正常运行。ssr中就报以上错误

修复方法:
1、把v-show=“show”放到了父组件中

原因:
猜测是在ssr代码在服务器端激活时报错。。

标签:Node,appendChild,vue,show,ssr,DOMException,报错,组件
来源: https://blog.csdn.net/qq_21859119/article/details/117261533