router的hash模式和history模式的区别
最直观的区别就是在url中 hash 带了一个很丑的 # 而history是没有#的。
配置方法:
1 const router = new VueRouter({ 2 mode: 'history', //实例化的时候添加mode字段即可,默认的是hash模式 3 routes: [...] 4 })
原理:
暂时不太理解。可以看这篇,很详细。
https://www.cnblogs.com/hy96/p/12967390.html
posted on 2021-05-07 10:39 chenzejie6030 阅读(95) 评论(0) 收藏 举报
浙公网安备 33010602011771号