]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
docs: add example about props
authorEduardo San Martin Morote <posva13@gmail.com>
Wed, 20 Apr 2022 13:51:50 +0000 (15:51 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Wed, 20 Apr 2022 13:51:50 +0000 (15:51 +0200)
Close #1375

Close #1361

docs/api/index.md

index 29b3a19d19d6ec2cbd52c0a0d4889c5474550116..38e94a661b8cb09e09cef42b928a57b20bfe43e4 100644 (file)
@@ -188,6 +188,14 @@ If you add a `target="_blank"` to your `a` element, you must omit the `@click="n
 - `Component`: VNodes to be passed to a `<component>`'s `is` prop.
 - `route`: resolved normalized [route location](#routelocationnormalized).
 
+Note you should be passing View components' props directly to the `<component>` rather than the `<router-view>`:
+
+```html
+<router-view v-slot="{ Component, route }">
+  <component :is="Component" view-prop="value" />
+</router-view>
+```
+
 ## createRouter
 
 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.