路由模式
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 脚手架里修改一个配置文件
路由模式
最新推荐文章于 2024-04-02 03:09:55 发布