hash模式url
vue-router默认hash模式——使用URL的hash来模拟一个完整的URL,因而当URL改变时,页面不会从新加载。
若是不想要这种默认的hash模式,能够用路由的history模式,这种模式充分的利用history.pushState API来完成URL跳转而无需从新加载页面。vue
index.js
Vue.use(Router) export default new Router({ mode: 'history', routes: [ { path:"/xxx", name:"xxx", component: Xxx, } ] })
history模式
修改以后url就变成了正常的urlvue-router