Skip to content

Commit f2a7060

Browse files
committed
Traduction de api/router-link.md
1 parent 33922e7 commit f2a7060

File tree

2 files changed

+55
-55
lines changed

2 files changed

+55
-55
lines changed

docs/en/SUMMARY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
- [Scroll Behavior (En)](advanced/scroll-behavior.md)
2424
- [Lazy Loading (En)](advanced/lazy-loading.md)
2525
- Réference de l'API
26-
- [router-link (En)](api/router-link.md)
26+
- [router-link](api/router-link.md)
2727
- [router-view (En)](api/router-view.md)
2828
- [The Route Object (En)](api/route-object.md)
2929
- [Router Constructor Options (En)](api/options.md)

docs/en/api/router-link.md

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,138 +1,138 @@
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 tag `<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="...">` hard-codé 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é 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 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
- **replace**
4646

47-
- type: `boolean`
47+
- type : `boolean`
4848

49-
- default: `false`
49+
- défaut : `false`
5050

51-
Setting `replace` prop will call `router.replace()` instead of `router.push()` when clicked, so the navigation will not leave a history record.
51+
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.
5252

5353
``` html
5454
<router-link :to="{ path: '/abc'}" replace></router-link>
5555
```
5656

5757
- **append**
5858

59-
- type: `boolean`
60-
61-
- default: `false`
59+
- type : `boolean`
6260

63-
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`.
61+
- défaut : `false`
6462

63+
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`.
64+
6565
``` html
6666
<router-link :to="{ path: 'relative/path'}" append></router-link>
6767
```
6868

6969
- **tag**
7070

71-
- type: `string`
71+
- type : `string`
7272

73-
- default: `"a"`
73+
- défaut : `"a"`
7474

75-
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.
75+
Parfois, on veut que `<router-link>` soit rendu avec un tag différent, ex : `<li>`. On peut alors utiliser la prop `tag` pour modifier le tag qui sera rendu, et il écoutera toujours aux événements de clic pour la navigation
7676

7777
``` html
7878
<router-link to="/foo" tag="li">foo</router-link>
79-
<!-- renders as -->
79+
<!-- rend -->
8080
<li>foo</li>
8181
```
8282

8383
- **active-class**
8484

85-
- type: `string`
85+
- type : `string`
8686

87-
- default: `"router-link-active"`
87+
- défaut : `"router-link-active"`
8888

89-
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.
89+
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.
9090

9191
- **exact**
9292

93-
- type: `boolean`
93+
- type : `boolean`
9494

95-
- default: `false`
95+
- défaut : `false`
9696

97-
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`.
97+
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`.
9898

99-
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:
99+
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`.
100100

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

108108
- **event**
109109

110110
> 2.1.0+
111111
112-
- type: `string | Array<string>`
112+
- type : `string | Array<string>`
113113

114-
- default: `'click'`
114+
- défaut : `'click'`
115115

116-
Specify the event(s) that can trigger the link navigation.
116+
Spécifie les événement(s) que peuvent lancer la navigation de lien.
117117

118118
- **exact-active-class**
119119

120120
> 2.5.0+
121121
122-
- type: `string`
122+
- type : `string`
123123

124-
- default: `"router-link-exact-active"`
124+
- défaut : `"router-link-exact-active"`
125125

126-
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.
126+
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.
127127

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

130-
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:
130+
Parfois, on voudrait que la classe active soit appliquer à 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>` :
131131

132132
``` html
133133
<router-link tag="li" to="/foo">
134134
<a>/foo</a>
135135
</router-link>
136136
```
137137

138-
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>`.
138+
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)