Skip to content

Commit 876d002

Browse files
committed
docs: api/router-view
1 parent 7c39e5f commit 876d002

File tree

3 files changed

+29
-1
lines changed

3 files changed

+29
-1
lines changed

docs/en/api/options.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Router Construction Options

docs/en/api/router-link.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
- When you are using the `base` option in HTML5 history mode, you don't need to include it in `to` prop's URLs.
1212

13-
#### Props
13+
### Props
1414

1515
- **to**
1616

docs/en/api/router-view.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# `<router-view>`
2+
3+
The `<router-view>` component is a functional component that renders the matched component for the given path. Components rendered in `<router-view>` can also contain its own `<router-view>`, which will render components for nested paths.
4+
5+
### Props
6+
7+
- **name**
8+
9+
- type: `string`
10+
11+
- default: `"default"`
12+
13+
When a `<router-view>` has a name, it will render the component with the corresponding name in the matched route record's `components` option. See [Named Views](../essentials/named-views.md) for an example.
14+
15+
### Behavior
16+
17+
Any non-name props will be passed along to the rendered component, however most of the time the per-route data is contained in the route's params.
18+
19+
Since it's just a component, it works with `<transition>` and `<keep-alive>`. When using the both together, make sure to use `<keep-alive>` inside:
20+
21+
``` html
22+
<transition>
23+
<keep-alive>
24+
<router-view></router-view>
25+
</keep-alive>
26+
</transition>
27+
```

0 commit comments

Comments
 (0)