-
Notifications
You must be signed in to change notification settings - Fork 103
events.md #50
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
events.md #50
Conversation
…ents # Conflicts: # src/v2/guide/events.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1ère relecture
src/v2/guide/events.md
Outdated
@@ -1,19 +1,19 @@ | |||
--- | |||
title: Event Handling | |||
title: Gestionnaire d'évènements |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gestion ou Gérer
src/v2/guide/events.md
Outdated
type: guide | ||
order: 9 | ||
--- | ||
|
||
## Listening to Events | ||
## Écoute des évènements |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Écouter
src/v2/guide/events.md
Outdated
@@ -42,15 +42,15 @@ var example1 = new Vue({ | |||
</script> | |||
{% endraw %} | |||
|
|||
## Method Event Handlers | |||
## Les méthodes de gestion d'évènements |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gestionnaires
src/v2/guide/events.md
Outdated
|
||
The logic for many event handlers will be more complex though, so keeping your JavaScript in the value of the `v-on` attribute simply isn't feasible. That's why `v-on` can also accept the name of a method you'd like to call. | ||
La logique avec beaucoup de gestionnaires d'évènements sera très certainement plus complexe, par conséquence, garder votre JavaScript dans la valeur de l'attribut v-on ne sera tout simplement pas possible. C'est pourquoi v-on peut aussi accepter le nom d'une méthode que vous voudriez appeler. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
par conséquent
gardez
feasible => faisable
quotes autour de v-on
(à 2 endroits)
src/v2/guide/events.md
Outdated
@@ -102,14 +102,14 @@ var example2 = new Vue({ | |||
</script> | |||
{% endraw %} | |||
|
|||
## Methods in Inline Handlers | |||
## Méthode d'écoute dans les attributs : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Méthodes appelées dans les valeurs d'attributs
(pas vraiment de traduction équivoque pour "inline")
src/v2/guide/events.md
Outdated
@@ -264,24 +264,24 @@ For example: | |||
<div @click.ctrl="doSomething">Do something</div> | |||
``` | |||
|
|||
<p class="tip">Note that modifier keys are different from regular keys and when used with `keyup` events, they have to be pressed when the event is emitted. In other words, `keyup.ctrl` will only trigger if you release a key while holding down `ctrl`. It won't trigger if you release the `ctrl` key alone.</p> | |||
<p class="tip">Notez que ces modificateurs de raccourcis sont différents des modificateurs usuels utilisé avec l'évènement `keyup`, ils doivent être pressé quand l'évènement est émis. En d'autres mots, `keyup.ctrl` sera déclenché uniquement si vous maintenez la touche `ctrl` enfoncée. Et rien ne sera déclenché si vous `ctrl` enfoncé la touche seulement.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utilisés avec
pressés
rien ne sera déclenché si vous relâchez uniquement la touche Ctrl
src/v2/guide/events.md
Outdated
|
||
### Mouse Button Modifiers | ||
### Modificateurs de raccourcis souris |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modificateurs de boutons de la souris
src/v2/guide/events.md
Outdated
|
||
You might be concerned that this whole event listening approach violates the good old rules about "separation of concerns". Rest assured - since all Vue handler functions and expressions are strictly bound to the ViewModel that's handling the current view, it won't cause any maintenance difficulty. In fact, there are several benefits in using `v-on`: | ||
Vous pourriez être inquiets du fait que l'ensemble de cette approche d'écouteurs d'évènements viole la bonne vieille règle de la séparation des préoccupations. Rassurez-vous - puisque toutes les fonctions et expressions sont strictement liées au « ViewModel » qui gère la vue courante, cela ne causera aucune difficulté de maintenance. En realité, il y a plusieurs bénéfices à utiliser `v-on` : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inquiet ? (dans le reste du texte on utilise le vouvoiement singulier)
cette approche d'écoute d'évènements
il y a plusieurs avantages
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vous pourriez être inquiet au singulier
src/v2/guide/events.md
Outdated
|
||
1. It's easier to locate the handler function implementations within your JS code by simply skimming the HTML template. | ||
1. Il est plus facile de localiser l'implémentation des fonctions de gestion du code JS en survolant le code HTML. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
des fonctions gestionnaires dans votre code JS
src/v2/guide/events.md
Outdated
|
||
2. Since you don't have to manually attach event listeners in JS, your ViewModel code can be pure logic and DOM-free. This makes it easier to test. | ||
2. Comme vous n'avez pas à attacher manuellement les écouteurs dans votre JS, le code du « ViewModel » peut-être purement logique et sans DOM. Ceci rend plus facile les tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
peut être
Ceci le rend plus facile à tester.
Signed-off-by: Bruno Lesieur <bruno.lesieur@gmail.com>
…gique vis à vis du paragraphe souris Signed-off-by: Bruno Lesieur <bruno.lesieur@gmail.com>
Merci @sylvainpolletvillard ! C'est ok, j'ai juste pas compris le coup de « inquiet » et du vouvoiement. |
inquiet au singulier, puisque dans tout le reste du texte on s'adresse à une seule personne en la vouvoyant |
Ah wui, j'y avais jamais réellement pensez. Mais du coup faudrait pas genre mettre inquiet(e) ?! XD |
Je pense que les dames ne s'offusqueront pas si on omet toutes les éventuelles marques de genre entre parenthèses dans la documentation :) |
Signed-off-by: Bruno Lesieur <bruno.lesieur@gmail.com>
Done pour tout @sylvainpolletvillard. Juste cette histoire du « Suppr. / suppr / SUPPR, etc. ». Si tu y tiens vraiment je te suis mais pour ce coup c'est le contrôle « delete » soit « suppression » en fr :) peut importe ce qu'il y a d'écrit sur le clavier. |
dans mon cas le chat s'appelle touche Suppr ^^ Attends l'avis d'un second relecteur pour trancher |
D'après mon chat, en Bépo, ma touche espace devrais s'appeler « TypeMatrix® » XD. Ça marche ! |
A vrai dire je m'en fous un peu, les deux sont parfaitement compréhensibles. On peut laisser comme ça |
Dernière modifications demandées pour
events.md
ajoutée.Si quelqu'un veut relire le travail de @Ti-Bretin avant le merge ! @forresst ? ou @sylvainpolletvillard
La PR originale qui ne bougeait plus : #27