{
path:'/home',
name:'Home',
redirect:'/index',
component:home,
children:[{
path:'/index',
name: 'Index',
component: Index,
meta:{
requireAuth:true
}
}]
},
1.加’/'表示根路径,不加是相对路径
2.redirect为重定向,默认使用绝对路径
3.子组件里面的path(只要能访问到子组件,父组件就会被渲染出来)
这样访问 http://localhost:8080/index
如果是 index(不加/) 呢 ,它代表是相对路径,那相对于谁呢,当然是父组件了。因此,如果你想访问次子组件就要这样访问 http://localhost:8080/home/index