各位,我用Vue框架做了一个web应用程序,它说在部署之前要获取dist文件,这是通过以下方式完成的:
npm run build构建dist文件后,我将整个应用程序文件夹放在我的FileZilla中。现在,当我试图打开网站时,它只显示空白页面。有人知道我是否在Vue框架中遗漏了什么步骤吗?
发布于 2020-02-25 23:32:37
根据您的服务器,如果您使用的是vue-router的“历史模式”,您必须进行特定的配置。例如在appache服务器上
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
</IfModule>更多配置:https://router.vuejs.org/guide/essentials/history-mode.html#example-server-configurations
https://stackoverflow.com/questions/60397599
复制相似问题