Skip to content

Commit 79cfb0a

Browse files
authored
Merge pull request #7 from Kocal/api/route-object.md
Traduction de `api/route-object.md`
2 parents 33d758c + a317deb commit 79cfb0a

File tree

2 files changed

+30
-30
lines changed

2 files changed

+30
-30
lines changed

docs/en/SUMMARY.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
- Réference de l'API
2626
- [router-link (En)](api/router-link.md)
2727
- [router-view (En)](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/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)