vue ssr 组件使用document 、window对象 加载问题


解决方法:

            

            

使用beforeMount 函数去加载组件,这样组件在服务端就不会渲染,组件还可以配合v-if去控制组件的渲染

参考文章