记录vue路由在hash模式和history模式下路径匹配

在hash模式下路由路径的匹配是从“#/”后面开始匹配

如:http://xxx.xxx.xxxx.cn/PAI/newui/index.html#/index.html 匹配到的$route.path路径是/index.html

在history模式下是从域名后开始匹配,匹配到hash部分(在该模式下需要后端同学的配合才能正确的访问到相应的页面)

如:http://xxx.xxx.xxxx.cn/PAI/newui/index.html#/index.html 匹配到的$route.path路径是/PAI/newui/index.html

posted @ 2020-08-24 17:16  闯入码途的水产人  阅读(712)  评论(0)    收藏  举报