router-默认配置
在默认的情况下,进入网站的首页,希望渲染首页的内容,
此时需要多配置一个路由映射。
const routes =[
{
path:'',
redirect:'/home'
},
{
path:'/home',
component:Home
},
{
path:'/about',
component:About
}
]
改变网页hash模式
在index文件中,Router实例中,添加mode
export default new Router({
routes,
mode:'history'
})