Skip to content

Commit 854c17e

Browse files
Merge pull request #9 from Kocal/api/router-link.md
Traduction de `api/router-link.md`
2 parents 592adf4 + 0d5d87d commit 854c17e

File tree

1 file changed

+54
-54
lines changed

1 file changed

+54
-54
lines changed

docs/en/api/router-link.md

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,55 @@
1-
# `<router-link>` (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+
# `<router-link>`
22

3-
`<router-link>` is the component for enabling user navigation in a router-enabled app. The target location is specified with the `to` prop. It renders as an `<a>` tag with correct `href` by default, but can be configured with the `tag` prop. In addition, the link automatically gets an active CSS class when the target route is active.
3+
`<router-link>` est le composant pour activer la navigation utilisateur dans une application où le routeur est activé. La localisation cible est spécifiée grâce à la prop `to`. Il est rendu en tant que balise `<a>` avec le `href` correct par défaut, mais peut être configuré grâce à la prop `tag`. De plus, le lien se vera attribuer une classe CSS active lorsque la route cible est active.
44

5-
`<router-link>` is preferred over hard-coded `<a href="...">` for the following reasons:
5+
`<router-link>` est préféré par rapport au `<a href="...">` en dur dans le code pour les raisons suivantes :
66

7-
- It works the same way in both HTML5 history mode and hash mode, so if you ever decide to switch mode, or when the router falls back to hash mode in IE9, nothing needs to be changed.
7+
- Cela fonctionne de la même manière qu'on soit dans le mode historique HTML5 ou le mode hash, donc si vous avez décidé de changer de mode, ou alors que le routeur se replie sur le mode hash pour IE9, rien n'a besoin d'être changé.
88

9-
- In HTML5 history mode, `router-link` will intercept the click event so that the browser doesn't try to reload the page.
9+
- Dans le mode historique HTML5, `router-link` interceptera l'évènement du clic, comme ça le navigateur n'essaiera pas de rafraîchir la page.
1010

11-
- When you are using the `base` option in HTML5 history mode, you don't need to include it in `to` prop's URLs.
11+
- En utilisant l'option `base` dans le mode historique HTML5, vous n'avez pas besoin de l'inclure dans les props `to` des URLs.
1212

1313
### Props
1414

1515
- **to**
1616

17-
- type: `string | Location`
17+
- type : `string | Location`
1818

19-
- required
20-
21-
Denotes the target route of the link. When clicked, the value of the `to` prop will be passed to `router.push()` internally, so the value can be either a string or a location descriptor object.
19+
- requis
2220

21+
Désigne la route cible du lien. Lorsqu'il est cliqué, la valeur de la prop `to` va être passée de manière interne à `router.push`, donc la valeur peut soit être une chaîne de caractères, ou alors un objet décrivant une localisation.
22+
2323
``` html
24-
<!-- literal string -->
25-
<router-link to="home">Home</router-link>
26-
<!-- renders to -->
27-
<a href="home">Home</a>
24+
<!-- chaîne litérale -->
25+
<router-link to="home">Accueil</router-link>
26+
<!-- rend -->
27+
<a href="home">Accueil</a>
2828

29-
<!-- javascript expression using `v-bind` -->
30-
<router-link v-bind:to="'home'">Home</router-link>
29+
<!-- expression JavaScript en utilisant `v-bind` -->
30+
<router-link v-bind:to="'home'">Accueil</router-link>
3131

32-
<!-- Omitting `v-bind` is fine, just as binding any other prop -->
33-
<router-link :to="'home'">Home</router-link>
32+
<!-- Omettre `v-bind` est ok, tout comme une autre prop -->
33+
<router-link :to="'home'">Accueil</router-link>
3434

35-
<!-- same as above -->
36-
<router-link :to="{ path: 'home' }">Home</router-link>
35+
<!-- pareil qu'au dessus -->
36+
<router-link :to="{ path: 'home' }">Accueil</router-link>
3737

38-
<!-- named route -->
39-
<router-link :to="{ name: 'user', params: { userId: 123 }}">User</router-link>
38+
<!-- route nommée -->
39+
<router-link :to="{ name: 'user', params: { userId: 123 }}">Utilisateur</router-link>
4040

41-
<!-- with query, resulting in `/register?plan=private` -->
42-
<router-link :to="{ path: 'register', query: { plan: 'private' }}">Register</router-link>
41+
<!-- avec une requête, résulte en `/register?plan=private` -->
42+
<router-link :to="{ path: 'register', query: { plan: 'private' }}">S'enregistrer</router-link>
4343
```
4444

4545

4646
- **replace**
4747

48-
- type: `boolean`
48+
- type : `boolean`
4949

50-
- default: `false`
50+
- défaut : `false`
5151

52-
Setting `replace` prop will call `router.replace()` instead of `router.push()` when clicked, so the navigation will not leave a history record.
52+
Configurer la prop `replace` appellera `router.replace()` au lieu de `router.push()` lors du clic, comme ça, la navigation ne laissera pas un enregistrement dans l'historique.
5353

5454
``` html
5555
<router-link :to="{ path: '/abc'}" replace></router-link>
@@ -58,85 +58,85 @@
5858

5959
- **append**
6060

61-
- type: `boolean`
62-
63-
- default: `false`
61+
- type : `boolean`
6462

65-
Setting `append` prop always appends the relative path to the current path. For example, assuming we are navigating from `/a` to a relative link `b`, without `append` we will end up at `/b`, but with `append` we will end up at `/a/b`.
63+
- défaut : `false`
6664

65+
Configurer la propriété `append` suffixe toujours le chemin relatif au chemin courant. Par exemple, assumons que nous naviguons de `/a` à un lien relatif `b`, sans `append` on finira sur `/b`, mais avec `append` on finira sur `/a/b`.
66+
6767
``` html
6868
<router-link :to="{ path: 'relative/path'}" append></router-link>
6969
```
7070

7171

7272
- **tag**
7373

74-
- type: `string`
74+
- type : `string`
7575

76-
- default: `"a"`
76+
- défaut : `"a"`
7777

78-
Sometimes we want `<router-link>` to render as another tag, e.g `<li>`. Then we can use `tag` prop to specify which tag to render to, and it will still listen to click events for navigation.
78+
Parfois, on veut que `<router-link>` soit rendu avec une balise différente, ex : `<li>`. On peut alors utiliser la prop `tag` pour modifier la balise qui sera rendue, et elle écoutera toujours les évènements de clic pour la navigation
7979

8080
``` html
8181
<router-link to="/foo" tag="li">foo</router-link>
82-
<!-- renders as -->
82+
<!-- rend -->
8383
<li>foo</li>
8484
```
8585

8686

8787
- **active-class**
8888

89-
- type: `string`
89+
- type : `string`
9090

91-
- default: `"router-link-active"`
91+
- défaut : `"router-link-active"`
9292

93-
Configure the active CSS class applied when the link is active. Note the default value can also be configured globally via the `linkActiveClass` router constructor option.
93+
Configure la classe CSS active qui sera appliquée lorsque le lien sera actif. Notez que la valeur par défaut peut aussi être configurée de manière globale via l'option `linkActiveClass` du constructeur du routeur.
9494

9595
- **exact**
9696

97-
- type: `boolean`
97+
- type : `boolean`
9898

99-
- default: `false`
99+
- défaut : `false`
100100

101-
The default active class matching behavior is **inclusive match**. For example, `<router-link to="/a">` will get this class applied as long as the current path starts with `/a/` or is `/a`.
101+
Le comportement par défaut de la correspondance de classe active est une **correspondance inclusive**. Par exemple, `<router-link to="/a">` vera cette classe appliquée tant que le chemin courant commencera par `/a/` ou `/a`.
102102

103-
One consequence of this is that `<router-link to="/">` will be active for every route! To force the link into "exact match mode", use the `exact` prop:
103+
Une conséquence de cela est que `<router-link to="/">` sera actif pour toutes les routes ! Pour forcer le lien dans un « mode correspondance exacte », utilisez la prop `exact`.
104104

105105
``` html
106-
<!-- this link will only be active at `/` -->
106+
<!-- ce lien sera uniquement actif à `/` -->
107107
<router-link to="/" exact>
108108
```
109-
110-
Checkout more examples explaining active link class [live](https://jsfiddle.net/8xrk1n9f/).
109+
110+
Allez voir les exemples expliquant la classe active pour les liens [ici](https://jsfiddle.net/8xrk1n9f/).
111111

112112
- **event**
113113

114114
> 2.1.0+
115115
116-
- type: `string | Array<string>`
116+
- type : `string | Array<string>`
117117

118-
- default: `'click'`
118+
- défaut : `'click'`
119119

120-
Specify the event(s) that can trigger the link navigation.
120+
Spécifie les évènement(s) que peu(ven)t lancer la navigation de lien.
121121

122122
- **exact-active-class**
123123

124124
> 2.5.0+
125125
126-
- type: `string`
126+
- type : `string`
127127

128-
- default: `"router-link-exact-active"`
128+
- défaut : `"router-link-exact-active"`
129129

130-
Configure the active CSS class applied when the link is active with exact match. Note the default value can also be configured globally via the `linkExactActiveClass` router constructor option.
130+
Configure la classe CSS active qui sera appliquée lorsqu'un lien sera actif avec une correspondance exact. Notez que la valeur par défaut peut aussi être configurée de manière globale via l'option `linkExactActiveClass` du constructeur du routeur.
131131

132-
### Applying Active Class to Outer Element
132+
### Appliquer la classe active à l'élément extérieur
133133

134-
Sometimes we may want the active class to be applied to an outer element rather than the `<a>` tag itself, in that case, you can render that outer element using `<router-link>` and wrap the raw `<a>` tag inside:
134+
Parfois, on voudrait que la classe active soit appliquée à un élément extérieur au lieu de l'élément `<a>` lui-même, dans ce cas, vous pouvez faire le rendu de cet élément extérieur en utilisant `<router-link>` et en entourant le tag `<a>` :
135135

136136
``` html
137137
<router-link tag="li" to="/foo">
138138
<a>/foo</a>
139139
</router-link>
140140
```
141141

142-
In this case the `<a>` will be the actual link (and will get the correct `href`), but the active class will be applied to the outer `<li>`.
142+
Dans ce cas, `<a>` sera le lien actuel (et récupérera le bon `href`), mais la classe active sera appliquée à l'élément extérieur `<li>`.

0 commit comments

Comments
 (0)