docs(API): 翻译完了 RouterLink

This commit is contained in:
Zhicheng Wang 2018-09-01 10:16:58 +08:00
parent f224ca6265
commit a6d7c47763
2 changed files with 60 additions and 2 deletions

View File

@ -21,8 +21,8 @@
[x] |forms/FormGroup | 3,096 | 0.96
[x] |forms/FormControl | 3,034 | 0.94
[x] |router/ActivatedRoute | 2,993 | 0.93
[ ] |forms/AbstractControl | 2,930 | 0.91
[ ] |router/RouterLink | 2,929 | 0.91
[x] |forms/AbstractControl | 2,930 | 0.91
[x] |router/RouterLink | 2,929 | 0.91
[ ] |core/ViewChild | 2,870 | 0.89
[x] |core/Directive | 2,767 | 0.86
[ ] |router/Routes | 2,331 | 0.72

View File

@ -22,31 +22,59 @@ import {UrlTree} from '../url_tree';
*
* Lets you link to specific routes in your app.
*
*
*
* Consider the following route configuration:
* `[{ path: 'user/:name', component: UserCmp }]`.
* When linking to this `user/:name` route, you use the `RouterLink` directive.
*
*
* `[{ path: 'user/:name', component: UserCmp }]`.
* `user/:name` 使 `RouterLink`
*
* If the link is static, you can use the directive as follows:
* `<a routerLink="/user/bob">link to user component</a>`
*
* 使
* `<a routerLink="/user/bob">链接到 user 组件</a>`
*
* If you use dynamic values to generate the link, you can pass an array of path
* segments, followed by the params for each segment.
*
*
*
* For instance `['/team', teamId, 'user', userName, {details: true}]`
* means that we want to generate a link to `/team/11/user/bob;details=true`.
*
* `['/team', teamId, 'user', userName, {details: true}]` `/team/11/user/bob;details=true`
*
* Multiple static segments can be merged into one
* (e.g., `['/team/11/user', userName, {details: true}]`).
*
* `['/team/11/user', userName, {details: true}]`
*
* The first segment name can be prepended with `/`, `./`, or `../`:
*
* 使 `/``./` `../`
*
* * If the first segment begins with `/`, the router will look up the route from the root of the
* app.
*
* `/`
*
* * If the first segment begins with `./`, or doesn't begin with a slash, the router will
* instead look in the children of the current activated route.
*
* `./`
*
* * And if the first segment begins with `../`, the router will go up one level.
*
* `../`
*
* You can set query params and fragment as follows:
*
* `#`
*
* ```
* <a [routerLink]="['/user/bob']" [queryParams]="{debug: true}" fragment="education">
* link to user component
@ -54,9 +82,13 @@ import {UrlTree} from '../url_tree';
* ```
* RouterLink will use these to generate this link: `/user/bob#education?debug=true`.
*
* RouterLink 使`/user/bob#education?debug=true`
*
* (Deprecated in v4.0.0 use `queryParamsHandling` instead) You can also tell the
* directive to preserve the current query params and fragment:
*
* v4.0.0 `queryParamsHandling` `?` `#`
*
* ```
* <a [routerLink]="['/user/bob']" preserveQueryParams preserveFragment>
* link to user component
@ -64,13 +96,27 @@ import {UrlTree} from '../url_tree';
* ```
*
* You can tell the directive to how to handle queryParams, available options are:
*
*
*
* - `'merge'`: merge the queryParams into the current queryParams
*
* `'merge'`
*
* - `'preserve'`: preserve the current queryParams
*
* `'preserve'`
*
* - default/`''`: use the queryParams only
*
* / `''`使
*
* Same options for {@link NavigationExtras#queryParamsHandling
* NavigationExtras#queryParamsHandling}.
*
* {@link NavigationExtras#queryParamsHandling
* NavigationExtras#queryParamsHandling}
*
* ```
* <a [routerLink]="['/user/bob']" [queryParams]="{debug: true}" queryParamsHandling="merge">
* link to user component
@ -79,13 +125,21 @@ import {UrlTree} from '../url_tree';
*
* The router link directive always treats the provided input as a delta to the current url.
*
* `RouterLink` URL
*
* For instance, if the current url is `/user/(box//aux:team)`.
*
* url `/user/(box//aux:team)`
*
* Then the following link `<a [routerLink]="['/user/jim']">Jim</a>` will generate the link
* `/user/(jim//aux:team)`.
*
* `<a [routerLink]="['/user/jim']">Jim</a>` `/user/(jim//aux:team)`
*
* See {@link Router#createUrlTree createUrlTree} for more information.
*
* {@link Router#createUrlTree createUrlTree}
*
* @ngModule RouterModule
*
*
@ -163,8 +217,12 @@ export class RouterLink {
*
* Lets you link to specific routes in your app.
*
*
*
* See `RouterLink` for more information.
*
* `RouterLink`
*
* @ngModule RouterModule
*
*