vue-cli 打包使用history模式的后端配置实例

apache的配置

这是windows下的

在httpd-vhosts.conf文件中把目录指向项目index.html文件所在的位置

rush:js;"> # Virtual Hosts # ServerName localhost DocumentRoot D:/wamp64/www/huanzuan/dist wamp64/www/huanzuan/dist"> Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all

然后再 index.html文件的同级路径下 创建.htaccess文件

rush:js;"> RewriteEngine On RewriteBase / RewriteRule ^index\.html$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.html [L]

内容就是官方文档给的 一点都不用改

然后确保 config/index.js中的build下的

rush:js;"> assetsPublicPath: '/',是绝对路径就可以了

以上这篇vue-cli 打包使用history模式的后端配置实例就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持编程之家。

相关文章

可以通过min-width属性来设置el-table-column的最小宽度。以...
yarn dev,当文件变动后,会自动重启。 yanr start不会自动重...
ref 用于创建一个对值的响应式引用。这个值可以是原始值(如...
通过修改 getWK005 函数来实现这一点。这里的 query 参数就是...
<el-form-item label="入库类型" ...
API 变动 样式类名变化: 一些组件的样式类名有所变动,可能需...