175 add a nested route

This commit is contained in:
Andreas Zweili 2021-04-26 10:09:17 +02:00
parent b41d3f087e
commit 68f4aa7168
2 changed files with 9 additions and 3 deletions

View File

@ -1,4 +1,5 @@
<template> <template>
<router-view></router-view>
<ul> <ul>
<teams-item <teams-item
v-for="team in teams" v-for="team in teams"

View File

@ -12,9 +12,14 @@ const router = createRouter({
history: createWebHistory(), history: createWebHistory(),
routes: [ routes: [
{ path: '/', component: TeamsList }, { path: '/', component: TeamsList },
{ path: '/teams', component: TeamsList }, {
{ path: '/users', component: UsersList }, path: '/teams',
{ path: '/teams/:teamId', component: TeamMembers, props: true } component: TeamsList,
children: [
{ path: ':teamId', component: TeamMembers, props: true }
]
},
{ path: '/users', component: UsersList }
] ]
}); });