Skip to content

Commit 9e9f345

Browse files
fix(docs): Added example for passing custom props
An example for passing custom props to `<router-view>` component. Closes #1361
1 parent e919c1d commit 9e9f345

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

docs/api/index.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,17 @@ If you add a `target="_blank"` to your `a` element, you must omit the `@click="n
188188
- `Component`: VNodes to be passed to a `<component>`'s `is` prop.
189189
- `route`: resolved normalized [route location](#routelocationnormalized).
190190

191+
### Example: Passing custom props to `<router-view>` component
192+
193+
```html
194+
<router-view v-slot="{ Component }">
195+
<component
196+
:is="Component"
197+
your-prop="your-value"
198+
/>
199+
</router-view>
200+
```
201+
191202
## createRouter
192203

193204
Creates a Router instance that can be used by a Vue app. Check the [`RouterOptions`](#routeroptions) for a list of all the properties that can be passed.

0 commit comments

Comments
 (0)