Skip to content

Commit bb61528

Browse files
committed
docs: fix named views
1 parent fe9111e commit bb61528

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

docs/guide/essentials/named-views.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
Sometimes you need to display multiple views at the same time instead of nesting them, e.g. creating a layout with a `sidebar` view and a `main` view. This is where named views come in handy. Instead of having one single outlet in your view, you can have multiple and give each of them a name. A `router-view` without a name will be given `default` as its name.
44

55
```html
6-
<router-view class="view left-sidebar" name="left-sidebar"></router-view>
6+
<router-view class="view left-sidebar" name="LeftSidebar"></router-view>
77
<router-view class="view main-content"></router-view>
8-
<router-view class="view right-sidebar" name="right-sidebar"></router-view>
8+
<router-view class="view right-sidebar" name="RightSidebar"></router-view>
99
```
1010

1111
A view is rendered by using a component, therefore multiple views require
@@ -20,8 +20,10 @@ const router = createRouter({
2020
path: '/',
2121
components: {
2222
default: Home,
23-
a: LeftSidebar,
24-
b: RightSidebar,
23+
// short for LeftSidebar: LeftSidebar
24+
LeftSidebar,
25+
// they match the `name` attribute on `<router-view>`
26+
RightSidebar,
2527
},
2628
},
2729
],

0 commit comments

Comments
 (0)