路由模式

mac2024-08-12  53

路由模式 hash 模式 当你使用 hash 模式时,url 在井号后面设置路由的访问,但是如果页面有锚点连接,会冲突 http://localhost:63342/vue/day06/08.html#/c/ujiuye?name=123 history 模式 当你使用 history 模式时,url 就像正常的 url 例如:http://yoursite.com/user/id,也好看! var router = new VueRouter({ mode:"history" 默认的是 hash 模式(后面带#号) routes }); 默认模式 hash //http://localhost:63342/day5/%E8%B7%AF%E7%94%B1%E5%B5%8C%E5%A5%97.html?_ijt=cd7n3lolv27mtmp8t16h9psot1#/index/tel //history(不带#):不能刷新页面 刷新页面会报错 //解决办法:vue-cli 脚手架里修改一个配置文件
最新回复(0)