diff --git a/src/components/nav/README.md b/src/components/nav/README.md index 3a9b449e856..26c5775d0b0 100644 --- a/src/components/nav/README.md +++ b/src/components/nav/README.md @@ -316,6 +316,64 @@ The `card-header` prop is only needed when you are applying `tabs` or `pills` st The `card-header` prop has no effect if the `` is `vertical`. +### Using with Vue Router + +Have your card `` control vue router nested routes via `` or `` +components, to created tabbed content that changes with route URL: + +```html +// On page with route `/some/route` +
+ + + + + + + +
+``` + +Note: Vue Router does not support defining active routes with hashes (`#`), which is why you must +define the "tab" content as child routes. + +**Example router config for above:** + + + +```js +const routes = [ + { + path: '/some/route', + component: SomeRouteComponent, + // Child route "tabs" + children: [ + { path: '', component: DefaultTabComponent }, + { path: 'foo', component: FooTabComponent }, + { path: 'bar', component: BarTabComponent } + ] + } +] +``` + +One can also use Vue Router +[named routes](https://router.vuejs.org/guide/essentials/named-routes.html#named-routes) and/or +route params instead of path based routes. + +For more details see: + +- [Vue Router ``](https://router.vuejs.org/api/#router-view) +- [Nuxt.JS ``](https://nuxtjs.org/api/components-nuxt-child) + ## Accessibility If you're using `` to provide a navigation bar, be sure to add a `role="navigation"` to the