Skip to content

Commit f8a9bd1

Browse files
Added example for passing custom props
1 parent 86e9d40 commit f8a9bd1

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

packages/docs/guide/essentials/passing-props.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,16 @@ const routes = [
7878
The URL `/search?q=vue` would pass `{query: 'vue'}` as props to the `SearchUser` component.
7979

8080
Try to keep the `props` function stateless, as it's only evaluated on route changes. Use a wrapper component if you need state to define the props, that way vue can react to state changes.
81+
82+
## Programmatically via RouterView
83+
84+
You can also pass down state from a parent component to nested route component via RouterView.
85+
86+
```html
87+
<RouterView v-slot="{ Component }">
88+
<component
89+
:is="Component"
90+
yourProp="your-value"
91+
/>
92+
</RouterView
93+
```

0 commit comments

Comments
 (0)