mode的两个值
- histroy:当你使用 history 模式时,URL 就像正常的 url,例如 http://jsapng.com/lms/,也好看!
- hash:默认’hash’值,但是hash看起来就像无意义的字符排列,不太好看也不符合我们一般的网址浏览习惯。
1 export default new Router({ 2 mode: 'history',//去除地址栏#号 3 routes: [ 4 { 5 path: '/', 6 name: 'Hello', 7 component: HelloWorld 8 } 9 ] 10 })