-
Notifications
You must be signed in to change notification settings - Fork 2
Traduction de advanced/transitions.md
#13
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
# Transitions (En) <br><br> *Cette page est en cours de traduction française. Revenez une autre fois pour lire une traduction achevée ou [participez à la traduction française ici](https://github.com/vuejs-fr/vue-router).* | ||
# Les transitions | ||
|
||
Since the `<router-view>` is essentially a dynamic component, we can apply transition effects to it the same way using the `<transition>` component: | ||
Vu que `<router-view>` est essentiellement un composant dynamique, on peut lui appliquer certains effets de transitions en utilisant le composant `<transition>` : | ||
|
||
``` html | ||
<transition> | ||
<router-view></router-view> | ||
</transition> | ||
``` | ||
|
||
[Everything about `<transition>`](http://vuejs.org/guide/transitions.html) works the same here. | ||
[Tout à propos de `<transition>`](http://vuejs.org/guide/transitions.html) fonctionne également ici de la même manière. | ||
|
||
### Per-Route Transition | ||
### Transition par route | ||
|
||
The above usage will apply the same transition for all routes. If you want each route's component to have different transitions, you can instead use `<transition>` with different names inside each route component: | ||
L'utilisation au dessus applique la même transition pour chaque route. Si vous voulez que les composants de route aient des transitions différentes, vous pouvez utiliser à la place `<transition>` avec des différents noms à l'intérieur de chaque composant de route : | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
``` js | ||
const Foo = { | ||
|
@@ -32,20 +32,20 @@ const Bar = { | |
} | ||
``` | ||
|
||
### Route-Based Dynamic Transition | ||
# Transition dynamique basée sur la route | ||
|
||
It is also possible to determine the transition to use dynamically based on the relationship between the target route and current route: | ||
Il est aussi possible de déterminer la transition à utiliser en se basant sur la relation entre la route cible et la route actuelle : | ||
|
||
``` html | ||
<!-- use a dynamic transition name --> | ||
<!-- utilise un nom de transition dynamique --> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. J'utilise quasiment systématiquement l'infinitif. C'est une proposition. Ça permet de pas avoir a rajouter des « on » comme c'est le cas un peut plus loin.
ou
|
||
<transition :name="transitionName"> | ||
<router-view></router-view> | ||
</transition> | ||
``` | ||
|
||
``` js | ||
// then, in the parent component, | ||
// watch the $route to determine the transition to use | ||
// et dans le composant parent, | ||
// on observe la $route pour déterminer la transition à utiliser | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Possiblement
|
||
watch: { | ||
'$route' (to, from) { | ||
const toDepth = to.path.split('/').length | ||
|
@@ -55,4 +55,4 @@ watch: { | |
} | ||
``` | ||
|
||
See full example [here](https://github.com/vuejs/vue-router/blob/dev/examples/transitions/app.js). | ||
Voir un exemple complet [ici](https://github.com/vuejs/vue-router/blob/dev/examples/transitions/app.js). |
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.
Mettre le lien vers la version FR : http://fr.vuejs.org/guide/transitions.html