Skip to content
This repository has been archived by the owner on Sep 3, 2024. It is now read-only.

Commit

Permalink
add layout as function
Browse files Browse the repository at this point in the history
  • Loading branch information
alexchopin committed Mar 24, 2017
1 parent be36811 commit 2bfb234
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions en/api/pages-layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@ description: Every file (first level) in the layouts directory will create a cus

> Every file (first level) in the layouts directory will create a custom layout accessible with the layout property in the page component.
- **Type:** `String` (default: `'default'`)
- **Type:** `String` or `Function` (default: `'default'`)

Use the `layout` key in your pages components to define which layout to use:

```js
export default {
layout: 'blog'
layout: 'blog',
// OR
layout (context) {
return 'blog'
}
}
```

Expand Down
2 changes: 1 addition & 1 deletion en/guide/routing.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ More information about the validate method: [API Pages validate](/api/pages-vali

Nuxt.js lets you create nested route by using the children routes of vue-router.

To define a nested route, you need to create a Vue file with the **same name as the directory** which contain your children views.
To define the parent component of a nested route, you need to create a Vue file with the **same name as the directory** which contain your children views.

<p class="Alert Alert--info">Don't forget to write `<nuxt-child/>` inside the parent component (.vue file).</p>

Expand Down

0 comments on commit 2bfb234

Please sign in to comment.