Skip to content

Commit 4864f6a

Browse files
authored
Merge branch 'working' into api/router-view.md
2 parents 60b53b5 + 79cfb0a commit 4864f6a

File tree

4 files changed

+58
-58
lines changed

4 files changed

+58
-58
lines changed

docs/en/SUMMARY.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@
1818
- Avancé
1919
- [Navigation Guards (En)](advanced/navigation-guards.md)
2020
- [Route Meta Fields (En)](advanced/meta.md)
21-
- [Transitions (En)](advanced/transitions.md)
21+
- [Les transitions](advanced/transitions.md)
2222
- [Data Fetching (En)](advanced/data-fetching.md)
23-
- [Scroll Behavior (En)](advanced/scroll-behavior.md)
23+
- [Comportement du défilement](advanced/scroll-behavior.md)
2424
- [Lazy Loading (En)](advanced/lazy-loading.md)
2525
- Réference de l'API
2626
- [router-link (En)](api/router-link.md)
2727
- [router-view](api/router-view.md)
28-
- [The Route Object (En)](api/route-object.md)
28+
- [L'objet Route](api/route-object.md)
2929
- [Router Constructor Options (En)](api/options.md)
3030
- [Router Instance (En)](api/router-instance.md)
3131
- [Component Injections (En)](api/component-injections.md)

docs/en/advanced/scroll-behavior.md

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
1-
# Scroll Behavior (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).*
1+
# Comportement du défilement
22

3-
When using client-side routing, we may want to scroll to top when navigating to a new route, or preserve the scrolling position of history entries just like real page reload does. `vue-router` allows you to achieve these and even better, allows you to completely customize the scroll behavior on route navigation.
3+
En utilisant le routage côté client, nous pourrions vouloir faire défiler la page jusqu'en haut lorsqu'on navigue vers une nouvelle route, ou alors préserver la position du défilement des entrées de l'historique comme le ferait une page réelle. `vue-router` vous permet de faire cela et, encore mieux, vous permet de changer le comportement du défilement pendant la navigation.
44

5-
**Note: this feature only works in HTML5 history mode.**
5+
**Note : cette fonctionnalité ne fonctionne qu'avec le mode historique HTML5.**
66

7-
When creating the router instance, you can provide the `scrollBehavior` function:
7+
Pendant la création de l'instance du routeur, vous pouvez renseigner la fonction `scrollBehavior` :
88

99
``` js
1010
const router = new VueRouter({
1111
routes: [...],
1212
scrollBehavior (to, from, savedPosition) {
13-
// return desired position
13+
// retourner la position désirée
1414
}
1515
})
1616
```
1717

18-
The `scrollBehavior` function receives the `to` and `from` route objects. The third argument, `savedPosition`, is only available if this is a `popstate` navigation (triggered by the browser's back/forward buttons).
18+
La fonction `scrollBehavior` reçoit les objets de route `to` et `from`. Le troisième argument, `savedPosition`, est disponible uniquement si c'est une navigation `popstate` (déclenchée par les boutons précédent/suivant du navigateur).
1919

20-
The function can return a scroll position object. The object could be in the form of:
20+
La fonction peut retourner un objet décrivant la position du défilement. L'objet peut être de la forme :
2121

22-
- `{ x: number, y: number }`
23-
- `{ selector: string }`
22+
- `{ x: number, y: number }`
23+
- `{ selector: String }`
2424

25-
If a falsy value or an empty object is returned, no scrolling will happen.
25+
Si une valeur équivalente à `false` ou un objet vide est retourné, aucun défilement ne sera produit.
2626

27-
For example:
27+
Par exemple :
2828

2929
``` js
3030
scrollBehavior (to, from, savedPosition) {
3131
return { x: 0, y: 0 }
3232
}
3333
```
3434

35-
This will simply make the page scroll to top for all route navigations.
35+
Cela permettra de défiler au haut de page à chaque navigation à travers les routes.
3636

37-
Returning the `savedPosition` will result in a native-like behavior when navigating with back/forward buttons:
37+
Retourner l'objet `savedPosition` résultera en un comportement quasi-natif en naviguant avec les boutons précédents/suivants :
3838

3939
``` js
4040
scrollBehavior (to, from, savedPosition) {
@@ -46,7 +46,7 @@ scrollBehavior (to, from, savedPosition) {
4646
}
4747
```
4848

49-
If you want to simulate the "scroll to anchor" behavior:
49+
Si vous voulez simuler le comportement « aller à l'ancre » :
5050

5151
``` js
5252
scrollBehavior (to, from, savedPosition) {
@@ -58,4 +58,4 @@ scrollBehavior (to, from, savedPosition) {
5858
}
5959
```
6060

61-
We can also use [route meta fields](meta.md) to implement fine-grained scroll behavior control. Check out a full example [here](https://github.com/vuejs/vue-router/blob/dev/examples/scroll-behavior/app.js).
61+
On peut aussi utiliser les [champs meta de route](meta.md) pour implémenter un contrôle bien précis pour le comportement du défilement. Allez voir un exemple complet [ici](https://github.com/vuejs/vue-router/blob/dev/examples/scroll-behavior/app.js).

docs/en/advanced/transitions.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
# 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).*
1+
# Les transitions
22

3-
Since the `<router-view>` is essentially a dynamic component, we can apply transition effects to it the same way using the `<transition>` component:
3+
Vu que `<router-view>` est essentiellement un composant dynamique, on peut lui appliquer certains effets de transitions en utilisant le composant `<transition>` :
44

55
``` html
66
<transition>
77
<router-view></router-view>
88
</transition>
99
```
1010

11-
[Everything about `<transition>`](http://vuejs.org/guide/transitions.html) works the same here.
11+
[Tout à propos de `<transition>`](http://fr.vuejs.org/v2/guide/transitions.html) fonctionne également ici de la même manière.
1212

13-
### Per-Route Transition
13+
### Transition par route
1414

15-
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:
15+
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 noms différents à l'intérieur de chaque composant de route :
1616

1717
``` js
1818
const Foo = {
@@ -32,20 +32,20 @@ const Bar = {
3232
}
3333
```
3434

35-
### Route-Based Dynamic Transition
35+
# Transition dynamique basée sur la route
3636

37-
It is also possible to determine the transition to use dynamically based on the relationship between the target route and current route:
37+
Il est aussi possible de déterminer la transition à utiliser en se basant sur la relation entre la route cible et la route actuelle :
3838

3939
``` html
40-
<!-- use a dynamic transition name -->
40+
<!-- utiliser un nom de transition dynamique -->
4141
<transition :name="transitionName">
4242
<router-view></router-view>
4343
</transition>
4444
```
4545

4646
``` js
47-
// then, in the parent component,
48-
// watch the $route to determine the transition to use
47+
// et dans le composant parent,
48+
// observer la `$route` pour déterminer la transition à utiliser
4949
watch: {
5050
'$route' (to, from) {
5151
const toDepth = to.path.split('/').length
@@ -55,4 +55,4 @@ watch: {
5555
}
5656
```
5757

58-
See full example [here](https://github.com/vuejs/vue-router/blob/dev/examples/transitions/app.js).
58+
Voir un exemple complet [ici](https://github.com/vuejs/vue-router/blob/dev/examples/transitions/app.js).

docs/en/api/route-object.md

+29-29
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,89 @@
1-
# The Route Object (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).*
1+
# L'objet `Route`
22

3-
A **route object** represents the state of the current active route. It contains parsed information of the current URL and the **route records** matched by the URL.
3+
Un **objet `Route`** représente l'état actuel de la route active. Il contient des informations analysées à propos de l'URL courante et **les itinéraires de route** appariés par l'URL.
44

5-
The route object is immutable. Every successful navigation will result in a fresh route object.
5+
L'objet `Route` est immutable. Chaque navigation qui se déroule avec succès résultera en un nouvel objet `Route`.
66

7-
The route object can be found in multiple places:
7+
L'objet `Route` peut être trouvé à plusieurs endroits :
88

9-
- Inside components as `this.$route`
9+
- À l'intérieur des composants en tant que `this.$route`
1010

11-
- Inside `$route` watcher callbacks
11+
- À l'intérieur des fonctions de rappel des observateurs de `$route`
1212

13-
- As the return value of calling `router.match(location)`
13+
- Comme valeur de retour après l'appel de `router.match(location)`
1414

15-
- Inside navigation guards as the first two arguments:
15+
- À l'intérieur des fonctions de sécurisation de la navigation, dans les deux premiers paramètres de la fonction :
1616

1717
``` js
1818
router.beforeEach((to, from, next) => {
19-
// to and from are both route objects
19+
// `to` et `from` sont tous les deux des objets Route
2020
})
2121
```
2222

23-
- Inside the `scrollBehavior` function as the first two arguments:
23+
- À l'intérieur de la fonction `scrollBehavior` dans les deux premiers arguments :
2424

2525
``` js
2626
const router = new VueRouter({
2727
scrollBehavior (to, from, savedPosition) {
28-
// to and from are both route objects
28+
// `to` et `from` sont tous les deux des objets Route
2929
}
3030
})
3131
```
3232

33-
### Route Object Properties
33+
### Propriétés de l'objet `Route`
3434

3535
- **$route.path**
3636

37-
- type: `string`
37+
- type : `string`
3838

39-
A string that equals the path of the current route, always resolved as an absolute path. e.g. `"/foo/bar"`.
39+
Une chaîne de caractères représentant le chemin de la route en cours, toujours résolue en tant que chemin absolu, ex : `"/foo/bar"`.
4040

4141
- **$route.params**
4242

43-
- type: `Object`
43+
- type : `Object`
4444

45-
An object that contains key/value pairs of dynamic segments and star segments. If there are no params the value will be an empty object.
45+
Un objet qui contient des pairs clé/valeur de segments dynamiques et segments *star*. S'il n'y a pas de paramètres, alors la valeur sera un objet vide.
4646

4747
- **$route.query**
4848

49-
- type: `Object`
50-
51-
An object that contains key/value pairs of the query string. For example, for a path `/foo?user=1`, we get `$route.query.user == 1`. If there is no query the value will be an empty object.
49+
- type : `Object`
5250

51+
Un objet qui contient des pairs clé/valeur de la requête au format d'une chaîne de caractères. Par exemple, pour un chemin `/foo?user=1`, on aura `$route.query.user == 1`. S'il n'y a pas de requête, alors la valeur sera un objet vide.
52+
5353
- **$route.hash**
5454

55-
- type: `string`
55+
- type : `string`
5656

57-
The hash of the current route (with the `#`), if it has one. If no hash is present the value will be an empty string.
57+
Le hash de la route courante (avec le `#`), s'il y en a un. S'il n'y a pas de hash, alors la valeur sera une chaîne de caractères vide.
5858

5959
- **$route.fullPath**
6060

61-
- type: `string`
61+
- type : `string`
6262

63-
The full resolved URL including query and hash.
63+
L'URL entièrement résolue, incluant la requête et le hash.
6464

6565
- **$route.matched**
6666

67-
- type: `Array<RouteRecord>`
67+
- type : `Array<RouteRecord>`
6868

69-
An Array containing **route records** for all nested path segments of the current route. Route records are the copies of the objects in the `routes` configuration Array (and in `children` Arrays):
69+
Un `Array` contenant les **les itinéraires de la route** pour chaque segment de chemin imbriqué de la route courante. Les itinéraires de la route sont des copies des objets dans le tableau de configuration `routes` (et dans les tableaux `children`).
7070

7171
``` js
7272
const router = new VueRouter({
7373
routes: [
74-
// the following object is a route record
74+
// l'objet qui suit est un itinéraire de route
7575
{ path: '/foo', component: Foo,
7676
children: [
77-
// this is also a route record
77+
// c'est aussi un itinéraire
7878
{ path: 'bar', component: Bar }
7979
]
8080
}
8181
]
8282
})
8383
```
8484

85-
When the URL is `/foo/bar`, `$route.matched` will be an Array containing both objects (cloned), in parent to child order.
85+
Lorsque l'URL sera `/foo/bar`, `$route.matched` sera un `Array` contenant les deux objets (clonés), dans l'ordre parent à l'enfant.
8686

8787
- **$route.name**
8888

89-
The name of the current route, if it has one. (See [Named Routes](../essentials/named-routes.md))
89+
Le nom de la route courante, si elle en a un. (Voir [Routes nommées](../essentials/named-routes.md)).

0 commit comments

Comments
 (0)