vue2项目添加了一个新页面,dev启动一切正常,打包到ngnix上就渲染不了 #11905
Unanswered
tongshenyima
asked this question in
Help/Questions
Replies: 1 comment
-
我尝试把这个页面挂到另一个页面的子路由下,然后通过this.$router.push这种方式跳转,就可以渲染出来了。直接通过地址就访问还是不会渲染dom,但是会执行这个页面的mounted中的代码 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
我看了路由是没问题的,因为会运行mounted中的代码,body中只有<script>标签,控制台没有报错,资源也全部加载到了,而且就只有这个新添加的页面会白屏,其他的都可以,我把这个页面的代码注释到只剩一些简单的标签才会渲染出来,只要有<v-for>这种标签就会白屏,本地dev启动一切正常


这个是打包到服务器上的情况
这个是dev启动的情况
data-v-0eabe9e5 这个div就是页面的内容,打包到服务器上这个div就直接消失了
Beta Was this translation helpful? Give feedback.
All reactions