Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relecture de vuex-store.md #17

Merged
merged 3 commits into from
Sep 25, 2017
Merged

Relecture de vuex-store.md #17

merged 3 commits into from
Sep 25, 2017

Conversation

MachinisteWeb
Copy link
Member

Revue de vuex-store.md

Signed-off-by: Bruno Lesieur <[email protected]>
---

> Using a store to manage the state is important to every big application, that's why nuxt.js implement [vuex](https://github.com/vuejs/vuex) in its core.
> L'utilisation d'un store pour gérer l'état est important pour toutes les applications de taille importante, c'est pourquoi [Vuex](https//vuex.vuejs.org/fr/) est implémenté au cœur de Nuxt.js.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"https://"

2. Add `vuex` module in the vendors bundle
3. Add the `store` option to the root `Vue` instance.
1. importera Vuex,
2. ajoutera le module `vuex` dans le packetage vendors,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"paquetage"

Pour aligner notamment avec "empaqueter".

@@ -133,7 +135,7 @@ And in your `pages/todos.vue`, using the `todos` module:
<input type="checkbox" :checked="todo.done" @change="toggle(todo)">
<span :class="{ done: todo.done }">{{ todo.text }}</span>
</li>
<li><input placeholder="What needs to be done?" @keyup.enter="addTodo"></li>
<li><input placeholder="Qu'est-ce qui dois être fait ?" @keyup.enter="addTodo"></li>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Qu'est-ce qui doit être fait ?"


The context is given to `nuxtServerInit` as the 2nd argument, it is the same as the `data` or `fetch` method except that `context.redirect()` and `context.error()` are omitted.
Le contexte est fourni par `nuxtServerInit` comme 2ème argument. C'est le même que pour les méthodes `data` et `fetch` excepté que `context.redirect()` et `context.error()` sont omis.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"2e argument"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nous n'avons pas utiliser « 2ᵉ » dans les documentations précédente. Pour plus de consistence je vais écrire deuxième.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pas de soucis pour ce cas là. Par contre, ce serait bien de changer à l'occasion dans les autres documentations (je peux m'en occuper) pour abréger correctement les adjectifs numéraux ordinaux :)

https://www.google.ch/search?q=abr%C3%A9viation+des+adjectifs+num%C3%A9raux+ordinaux&oq=abbr%C3%A9viation+des+a&aqs=chrome.4.69i57j0l5.8687j0j7&sourceid=chrome&ie=UTF-8

Signed-off-by: Bruno Lesieur <[email protected]>
@MachinisteWeb
Copy link
Member Author

Merci @rspt pour tes retours !

Copy link

@forresst forresst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quelques remarques

3. Add the `store` option to the root `Vue` instance.
1. importera Vuex,
2. ajoutera le module `vuex` dans le paquetage vendors,
3. ajoutera l'option `store` à l'instance racine de Vue.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vue => Vue

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

J'ai déjà corrigé das l'originale. Dès qu'on parle de l'instance racine on se réfère toujours au titre produit :
Source (chercher root) :
https://vuejs.org/v2/guide/instance.html
https://vuejs.org/v2/guide/components.html
— ...


- **Classic:** `store/index.js` returns a store instance
- **Modules:** every `.js` file inside the `store` directory is transformed as a [namespaced module](http://vuex.vuejs.org/en/modules.html) (`index` being the root module)
- **Classique :** `store/index.js` retourne une instance.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

store/index.js retourne une instance de store.


To activate the store with the classic mode, we create the `store/index.js` file which should export a method which returns a Vuex instance:
Pour activer le store avec le mode classique, nous créons `store/index.js` dans lequel nous exportons l'instance du store :

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dans lequel nous exportons l'instance du store : => qui devrait exporter une méthode qui renvoie une instance Vuex :


> Note: Asynchronous `nuxtServerInit` actions must return a Promise to allow the `nuxt` server to wait on them.
> Note : Les actions `nuxtServerInit` asynchrones doivent retourner une promesse pour permettre au serveur `nuxt` de les attendres.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

attendres => attendre

@MachinisteWeb
Copy link
Member Author

MachinisteWeb commented Sep 23, 2017 via email

Signed-off-by: Bruno Lesieur <[email protected]>
@MachinisteWeb MachinisteWeb merged commit d685338 into working Sep 25, 2017
@MachinisteWeb MachinisteWeb deleted the vuex-store branch September 25, 2017 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants