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

Traduction de structure.md #10

Merged
merged 2 commits into from
May 20, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions docs/en/structure.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Application Structure
# Structure d'une application

Vuex doesn't really restrict how you structure your code. Rather, it enforces a set of high-level principles:
Vuex ne vous restreint pas vraiment dans la façon dont vous voulez structurer votre code. Il impose plutôt un set de principes de haut niveau :
Copy link
Member Author

@MachinisteWeb MachinisteWeb May 20, 2017

Choose a reason for hiding this comment

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

Vuex ne vous restreint pas quand à la structure de code à utiliser.

Il impose plutôt de respecter des principes de haut niveau


1. Application-level state is centralized in the store.
1. Le state d'application est centralisé dans le store.
Copy link
Member Author

Choose a reason for hiding this comment

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

L'état de l'application


2. The only way to mutate the state is by committing **mutations**, which are synchronous transactions.
2. La seule façon de muter le state est de commiter des **mutations**, qui sont des transactions synchrones.
Copy link
Member Author

Choose a reason for hiding this comment

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

muter l'état

est d'acter des


3. Asynchronous logic should be encapsulated in, and can be composed with **actions**.
3. La logique asynchrone doit être composée et encapsulée dans des **actions**.

As long as you follow these rules, it's up to you how to structure your project. If your store file gets too big, simply start splitting the actions, mutations and getters into separate files.
Tant que vous suivez ces règles, c'est à vous de structurer votre projet. Si votre fichier de store devient trop gros, commencez simplement par séparer les actions, mutations et getters dans des fichiers séparés.
Copy link
Member Author

Choose a reason for hiding this comment

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

commencez dès lors à séparer les actions, mutations et accesseurs


For any non-trivial app, we will likely need to leverage modules. Here's an example project structure:
Pour une application non-triviale, nous aurons probablement besoin de faire appel à des modules. Voici un exemple de structure de projet :

``` bash
├── index.html
Expand All @@ -21,12 +21,12 @@ For any non-trivial app, we will likely need to leverage modules. Here's an exam
│   ├── App.vue
│   └── ...
└── store
├── index.js # where we assemble modules and export the store
├── actions.js # root actions
├── mutations.js # root mutations
├── index.js # Là où l'on assemble nos modules et exportons le store
├── actions.js # Actions racine
├── mutations.js # Mutations racine
└── modules
   ├── cart.js # cart module
   └── products.js # products module
Copy link
Member Author

Choose a reason for hiding this comment

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

À traduire

```

As a reference, check out the [Shopping Cart Example](https://github.com/vuejs/vuex/tree/dev/examples/shopping-cart).
Vous pouvez jeter à un œil à [l'exemple Shopping Cart](https://github.com/vuejs/vuex/tree/dev/examples/shopping-cart).
Copy link
Member Author

Choose a reason for hiding this comment

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