history
根目录
路由mode变为history后,需要在服务器配置 url重写,在根目录 创建web.config文件 加下面内容复制进去
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Handle History Mode and custom 404/500" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
&n

本文详细介绍了在使用Vue Router的history模式时,如何在根目录和子目录下进行服务器URL重写配置,确保应用在不同环境下正确运行。同时,提供了调整Webpack配置和router.js中base路径的方法。
最低0.47元/天 解锁文章
955

被折叠的 条评论
为什么被折叠?



