vue的路由嵌套

1.需要在 Router 的参数中使用 children 配置:

PS:登录成功后跳转到action组件,action组件嵌套了多个子组件,渲染左边的导航栏(fixed)和默认渲染index的内容。相当于只有登录和action两个页面
{
path: ‘/action’, component: action, name: ‘action’,
children: [
{ path: ‘/’, component: index, name: ‘index’ },
{ path: ‘index’, component: index, name: ‘index’}
]
}
在这里插入图片描述

2.登录成功后的效果图如下

在这里插入图片描述

3.路由跳转都是在action/后面

在这里插入图片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章