🌐 AI搜索 & 代理 主页
Skip to content

Commit a090d7a

Browse files
tmorehousejacobmllr95
authored andcommitted
docs(b-nav): add name to default tab route in vue-router example (#4059)
* docs(b-nav): add name to default tab route in vue-router example * Update README.md * Update README.md
1 parent f488dc1 commit a090d7a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/components/nav/README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,10 +348,15 @@ define the "tab" content as child routes.
348348
const routes = [
349349
{
350350
path: '/some/route',
351+
// We don't provide a name on this parent route, but rather
352+
// set the name on the default child route instead
353+
// name: 'some-route',
351354
component: SomeRouteComponent,
352355
// Child route "tabs"
353356
children: [
354-
{ path: '', component: DefaultTabComponent },
357+
// Note we provide the above parent route name on the default child tab
358+
// route to ensure this tab is rendered by default when using named routes
359+
{ path: '', component: DefaultTabComponent, name: 'some-route' },
355360
{ path: 'foo', component: FooTabComponent },
356361
{ path: 'bar', component: BarTabComponent }
357362
]

0 commit comments

Comments
 (0)