This repository has been archived by the owner on Sep 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 937
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
title: "API: la propriété layout" | ||
description: Chaque fichier (premier niveau) dans le répertoire layouts créera un layout personnalisé accessible avec la propriété layout dans le composant page. | ||
--- | ||
|
||
# La propriété layout | ||
|
||
> Chaque fichier (premier niveau) dans le répertoire layouts créera un layout personnalisé accessible avec la propriété layout dans le composant page. | ||
- **Type:** `String` ou `Function` (defaut: `'default'`) | ||
|
||
Utilisez la clef `layout` dans vos composants de pages pour définir le layout à utiliser: | ||
|
||
```js | ||
export default { | ||
layout: 'blog', | ||
// OU | ||
layout (context) { | ||
return 'blog' | ||
} | ||
} | ||
``` | ||
|
||
Dans cet exemple, Nuxt.js incluera le fichier `layouts/blog.vue` comme layout pour ce composant page. | ||
|
||
En action dans [cette vidéo de démonstration](https://www.youtube.com/watch?v=YOKnSTp7d38). | ||
|
||
Afin de comprendre comment les layouts fonctionnent avec nuxt.js, regarder la [documentation sur les layouts](/guide/views#layouts). |