You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: Données asynchrones dans les composants ?
4
4
---
5
5
6
-
# Async data in components? (En)
6
+
# Données asynchrones dans les composants ?
7
7
8
-
<pstyle="width: 294px;position: fixed; top : 64px; right: 4px;"class="Alert Alert--orange"><strong>⚠Cette page est actuellement en cours de traduction française. Vous pouvez repasser plus tard ou <ahref="https://github.com/vuejs-fr/nuxt"target="_blank">participer à la traduction</a> de celle-ci dès maintenant !</strong></p><p>Because components do not have an asyncData method, you cannot directly fetch async data server side within a component. In order to get around there limitation you have two basic options:</p>
8
+
Étant donné que les composants ne comportent pas de méthode `asyncData`, vous ne pouvez pas récupérer directement côté serveur de données asynchrones dans un composant. Pour contourner cette limitation, vous avez deux possibilités :
9
9
10
-
1.Make the API call in the mounted() hook and set data properties when loaded. *Downside: Won't work for server side rendering.*
11
-
2.Make the API call in the asyncData() or fetch() methods of the page component and pass the data as props to the sub components. Server rendering will work fine. *Downside: the asyncData() or fetch() of the page might be less readable because it's loading the data for other components*
10
+
1.Effectuez l'appel à l'API dans le point d'ancrage `mounted` et définissez les données quand le composant est chargé. *Problème : ne fonctionne pas pour le rendu côté serveur*.
11
+
2.Effectuez l'appel à l'API dans la méthode `asyncData` ou `fetch` du composant de page et passez les données en tant que props au sous-composant. Le rendu côté serveur fonctionnera. *Problème : les méthodes `asyncData` ou `fetch` pour une page peuvent êtres moins lisibles car elles chargent les données pour d'autres composants*.
description: Why a CSS Flash appears with Nuxt.js?
3
+
description: Pourquoi un flash CSS apparaît avec Nuxt.js?
4
4
---
5
5
6
-
# Why a CSS Flash appears? (En)
6
+
# Pourquoi un flash CSS apparaît ?
7
7
8
8

9
9
10
-
<pstyle="width: 294px;position: fixed; top : 64px; right: 4px;"class="Alert Alert--orange"><strong>⚠Cette page est actuellement en cours de traduction française. Vous pouvez repasser plus tard ou <ahref="https://github.com/vuejs-fr/nuxt"target="_blank">participer à la traduction</a> de celle-ci dès maintenant !</strong></p><p>This is because the CSS is in the JavaScript build in **development mode** to allow hot-reloading via Webpack.</p>
10
+
C'est parce qu'en **mode développement** le CSS se trouve dans le JavaScript afin de permettre le rechargement à chaud via Webpack. Ce flash est appelé [FOUC](https://fr.wikipedia.org/wiki/FOUC).
11
11
12
-
Don't worry in production mode, the CSS is separated and put in the header so this "flash" does not appear anymore.
12
+
Ne vous inquiétez pas, en **mode production** le CSS est séparé et placé dans l'en-tête afin que le phénomène de FOUC n'apparaisse plus.
description: How to deploy a Nuxt.js application on Dokku?
2
+
title: Déploiement sur Dokku
3
+
description: Comment déployer une application Nuxt.js sur Dokku?
4
4
---
5
5
6
-
# How to deploy on Dokku? (En)
6
+
# Comment déployer sur Dokku ?
7
7
8
-
<pstyle="width: 294px;position: fixed; top : 64px; right: 4px;"class="Alert Alert--orange"><strong>⚠Cette page est actuellement en cours de traduction française. Vous pouvez repasser plus tard ou <ahref="https://github.com/vuejs-fr/nuxt"target="_blank">participer à la traduction</a> de celle-ci dès maintenant !</strong></p><p>We recommend to read [Dokku documentation for the setup](http://dokku.viewdocs.io/dokku/getting-started/installation/) and [Deploying a Node.js Application on Digital Ocean using dokku](http://jakeklassen.com/post/deploying-a-node-app-on-digital-ocean-using-dokku/)</p>
8
+
Nous vous recommandons de lire la [documentation de la prise en main de Dokku](http://dokku.viewdocs.io/dokku/getting-started/installation/)et[Deploying a Node.js Application on Digital Ocean using dokku](http://jakeklassen.com/post/deploying-a-node-app-on-digital-ocean-using-dokku/).
9
9
10
-
For the example, we will call our nuxt.js application `my-nuxt-app`
10
+
Pour l'exemple, nous allons appeler notre application Nuxt.js `my-nuxt-app`.
11
11
12
-
We need to tell Dokku to install the `devDependencies`of the project (to be able to launch `npm run build`):
12
+
Demandons à Dokku d'installer les `devDependencies`de notre projet (afin de pouvoir exécuter `npm run build`):
description: Balises meta dupliquées avec Nuxt.js?
4
4
---
5
5
6
-
# Duplicated Meta tags? (En)
6
+
# Balises meta dupliquées ?
7
7
8
-
<pstyle="width: 294px;position: fixed; top : 64px; right: 4px;"class="Alert Alert--orange"><strong>⚠Cette page est actuellement en cours de traduction française. Vous pouvez repasser plus tard ou <ahref="https://github.com/vuejs-fr/nuxt"target="_blank">participer à la traduction</a> de celle-ci dès maintenant !</strong></p><p>This is a "feature" of [vue-meta](https://github.com/declandewet/vue-meta), please take a look at the [documentation of head elements](/guide/views#html-head).</p>
8
+
Il s'agit d'une « fonctionnalité » de [vue-meta](https://github.com/declandewet/vue-meta), merci de lire la [documentation des éléments d'entête](/guide/views#html-head).
9
9
10
-
> To avoid any duplication when used in child component, please give an unique identifier with the `hid` key, please [read more](https://github.com/declandewet/vue-meta#lists-of-tags) about it.
10
+
> Afin d'éviter toute duplication lors de l'utilisation d'un composant enfant, donner un identifiant unique à l'aide de la clé `hid`. [En savoir plus](https://github.com/declandewet/vue-meta#lists-of-tags).
11
11
12
-
For the meta description, you need to add the unique identifier `hid` so vue-meta will know that it has to overwrite the default tag.
12
+
Pour la meta description, vous devez ajouter un identifiant unique `hid` afin que vue-meta sache qu'il doit remplacer la balise par défaut.
Copy file name to clipboardExpand all lines: en/faq/extend-webpack.md
+5-5
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,16 @@
1
1
---
2
-
title: Extend Webpack
3
-
description: How to extend webpack config into my Nuxt.js application?
2
+
title: Étendre webpack
3
+
description: Comment étendre la configuration de webpack dans mon application Nuxt.js ?
4
4
---
5
5
6
-
# How to extend webpack config? (En)
6
+
# Comment étendre la configuration de webpack ?
7
7
8
-
<pstyle="width: 294px;position: fixed; top : 64px; right: 4px;"class="Alert Alert--orange"><strong>⚠Cette page est actuellement en cours de traduction française. Vous pouvez repasser plus tard ou <ahref="https://github.com/vuejs-fr/nuxt"target="_blank">participer à la traduction</a> de celle-ci dès maintenant !</strong></p><p>You can extend the webpack configuration via the `extend` option in your `nuxt.config.js`:</p>
8
+
Vous pouvez étendre la configuration de webpack via l'option`extend`de votre fichier`nuxt.config.js` :
Copy file name to clipboardExpand all lines: en/faq/external-resources.md
+7-7
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,13 @@
1
1
---
2
-
title: External resources
3
-
description: How to use external resources with Nuxt.js?
2
+
title: Ressources externes
3
+
description: Comment utiliser des ressources externes avec Nuxt.js?
4
4
---
5
5
6
-
# How to use external resources? (En)
6
+
# Comment utiliser des ressources externes ?
7
7
8
-
## Global Settings
8
+
## Paramètres globaux
9
9
10
-
<pstyle="width: 294px;position: fixed; top : 64px; right: 4px;"class="Alert Alert--orange"><strong>⚠Cette page est actuellement en cours de traduction française. Vous pouvez repasser plus tard ou <ahref="https://github.com/vuejs-fr/nuxt"target="_blank">participer à la traduction</a> de celle-ci dès maintenant !</strong></p><p>Include your resources in the `nuxt.config.js` file:</p>
10
+
Inclure vos ressources dans le fichier `nuxt.config.js`:
11
11
12
12
```js
13
13
module.exports= {
@@ -22,9 +22,9 @@ module.exports = {
22
22
}
23
23
```
24
24
25
-
## Local Settings
25
+
## Paramètres locaux
26
26
27
-
Include your resources in your `.vue`file inside the`pages/`directory:
27
+
Inclure vos ressources dans votre fichier `.vue`dans votre répertoire`pages/` :
Copy file name to clipboardExpand all lines: en/faq/github-pages.md
+12-13
Original file line number
Diff line number
Diff line change
@@ -1,34 +1,33 @@
1
1
---
2
-
title: GitHub Pages Deployment
3
-
description: How to deploy Nuxt.js on GitHub Pages?
2
+
title: Déployer sur GitHub Pages
3
+
description: Comment déployer une application Nuxt.js sur GitHub Pages
4
4
---
5
5
6
-
# How to deploy on GitHub Pages? (En)
6
+
# Comment déployer sur GitHub Pages ?
7
7
8
-
<pstyle="width: 294px;position: fixed; top : 64px; right: 4px;"class="Alert Alert--orange"><strong>⚠Cette page est actuellement en cours de traduction française. Vous pouvez repasser plus tard ou <ahref="https://github.com/vuejs-fr/nuxt"target="_blank">participer à la traduction</a> de celle-ci dès maintenant !</strong></p><p>Nuxt.js gives you the possibility to host your web application on any static hosting like [GitHub Pages](https://pages.github.com/) for example.</p>
8
+
Nuxt.js vous offre la possibilité d'héberger votre application web sur n'importe quel hébergeur statique tel que [GitHub Pages](https://pages.github.com/)par exemple.
9
9
10
-
To deploy on GitHub Pages, you need to generate your static web application:
10
+
Pour déployer sur GitHub Pages, vous devez générer votre applicaiton web de manière statique :
11
11
12
12
```bash
13
13
npm run generate
14
14
```
15
15
16
-
It will create a `dist` folder with everything inside ready to be deployed on GitHub Pages hosting.
17
-
Branch `gh-pages` for project repository OR branch `master` for user or organization site
16
+
Cette commande créé un répertoire `dist` contenant l'intégralité de l'application prête à être déployée sur GitHub Pages. Cela sur la branche `gh-pages` pour un dépôt de projet OU sur la branche `master` pour le site d'un utilisateur ou d'une organisation.
18
17
19
-
<pclass="Alert Alert--nuxt-green"><b>INFO:</b> If you use a custom domain for your GitHub Pages and put `CNAME` file, it is recommended that CNAME file is put in the `static` directory. [More documentation](/guide/assets#static) about it.</p>
18
+
<pclass="Alert Alert--nuxt-green"><b>Info :</b> si vous utilisez un nom de domaine personalisé pour GitHub Pages à l'aide d'un fichier `CNAME`, il est recommandé de placer ce fichier dans le répertoire `static`. [Plus d'informations](/guide/assets#static) à ce propos.</p>
20
19
21
-
## Command line deployment
20
+
## Déploiement en ligne de commande
22
21
23
-
You can also use [push-dir package](https://github.com/L33T-KR3W/push-dir):
22
+
Vous pouvez également utiliser le package [push-dir](https://github.com/L33T-KR3W/push-dir):
24
23
25
-
First install it via npm:
24
+
Installez le via npm:
26
25
27
26
```bash
28
27
npm install push-dir --save-dev
29
28
```
30
29
31
-
Add a `deploy`command to your package.json with the branch as `gh-pages`for project repository OR `master`for user or organization site.
30
+
Ajouter une commande `deploy`à votre `package.json` avec la branche `gh-pages`pour un dépôt de projet OU avec la branche `master`pour le site d'un utilisateur ou d'une organisation.
32
31
33
32
```js
34
33
"scripts": {
@@ -40,7 +39,7 @@ Add a `deploy` command to your package.json with the branch as `gh-pages` for pr
40
39
},
41
40
```
42
41
43
-
Then generate and deploy your static application:
42
+
Puis générez et déployez votre application statique :
<pstyle="width: 294px;position: fixed; top : 64px; right: 4px;"class="Alert Alert--orange"><strong>⚠Cette page est actuellement en cours de traduction française. Vous pouvez repasser plus tard ou <ahref="https://github.com/vuejs-fr/nuxt"target="_blank">participer à la traduction</a> de celle-ci dès maintenant !</strong></p><p>First, please check the [official Google Analytics module](https://github.com/nuxt-community/modules/tree/master/modules/google-analytics) for nuxt.js*</p>
8
+
Tout d'abord consultez le [module officiel Google Analytics](https://github.com/nuxt-community/modules/tree/master/modules/google-analytics)pour Nuxt.js.
9
9
10
-
Ortherwise, to use[Google Analytics](https://analytics.google.com/analytics/web/)with your nuxt.js application, we recommend to create a file`plugins/ga.js`:
10
+
Ensuite, pour utiliser[Google Analytics](https://analytics.google.com/analytics/web/)avec votre application Nuxt.js, nous recommandons de créer un plugin`plugins/ga.js`:
11
11
12
12
```js
13
13
/* eslint-disable */
14
14
15
15
exportdefault ({ app }) => {
16
16
/*
17
-
** Only run on client-side and only in production mode
<pstyle="width: 294px;position: fixed; top : 64px; right: 4px;"class="Alert Alert--orange"><strong>⚠Cette page est actuellement en cours de traduction française. Vous pouvez repasser plus tard ou <ahref="https://github.com/vuejs-fr/nuxt"target="_blank">participer à la traduction</a> de celle-ci dès maintenant !</strong></p><p>We recommend you to read the [Heroku documentation for node.js](https://devcenter.heroku.com/articles/nodejs-support).</p>
8
+
Nous vous recommandons de lire la [documentation Heroku pour Node.js](https://devcenter.heroku.com/articles/nodejs-support).
9
+
10
+
Premièrement, nous devons demander à Heroku d'installer les `devDependencies` du projet (afin de pouvoir exécuter `npm run build`) :
9
11
10
-
First, we need to tell Heroku to install the `devDependencies` of the project (to be able to launch `npm run build`):
11
12
```bash
12
13
heroku config:set NPM_CONFIG_PRODUCTION=false
13
14
```
14
15
15
-
Also, we want our application to listen on the host `0.0.0.0` and run in production mode:
16
+
Nous voulons également que notre application écoute le port `0.0.0.0` et s'exécute en mode production :
17
+
16
18
```bash
17
19
heroku config:set HOST=0.0.0.0
18
20
heroku config:set NODE_ENV=production
19
21
```
20
22
21
-
You should see this in your Heroku dashboard (Settings section):
23
+
Vous devriez voir cela dans votre tableau de bord Heroku (section Settings) :
22
24
23
25

24
26
25
-
Then, we tell Heroku to launch `npm run build` via the `heroku-postbuild` script in our `package.json`:
27
+
Puis nous demandons à Heroku d'exécuter `npm run build` via le script `heroku-postbuild` de notre `package.json` :
28
+
26
29
```js
27
30
"scripts": {
28
31
"dev":"nuxt",
@@ -32,9 +35,10 @@ Then, we tell Heroku to launch `npm run build` via the `heroku-postbuild` script
32
35
}
33
36
```
34
37
35
-
Finally, we can push the app on Heroku with:
38
+
Pour finir, nous pouvons déployer notre application sur Heroku :
39
+
36
40
```bash
37
41
git push heroku master
38
42
```
39
43
40
-
Voilà! Your nuxt.js application is now hosted on Heroku!
44
+
Voilà! Votre application Nuxt.js est hébergée sur Heroku!
0 commit comments