<el-main> <!-- 路由占位符 顯示子路由內容 --> <router-view></router-view> </el-main>
路由設置:
{ path: '/home', component: Home, redirect: '/welcome', //重定向到子路由 children: [ //配置子路由 { path: '/welcome', component: Welcome } ] }
和router-link配合使用。
element-UI的el-menu提供了路由配置屬性:router
需注意,以index作為path進行路由跳轉