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>
<router-view></router-view>
<ul>
<teams-item
v-for="team in teams"

View File

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