docs(API): 翻译完了 RouterLink
This commit is contained in:
parent
f224ca6265
commit
a6d7c47763
@ -21,8 +21,8 @@
|
|||||||
[x] |forms/FormGroup | 3,096 | 0.96
|
[x] |forms/FormGroup | 3,096 | 0.96
|
||||||
[x] |forms/FormControl | 3,034 | 0.94
|
[x] |forms/FormControl | 3,034 | 0.94
|
||||||
[x] |router/ActivatedRoute | 2,993 | 0.93
|
[x] |router/ActivatedRoute | 2,993 | 0.93
|
||||||
[ ] |forms/AbstractControl | 2,930 | 0.91
|
[x] |forms/AbstractControl | 2,930 | 0.91
|
||||||
[ ] |router/RouterLink | 2,929 | 0.91
|
[x] |router/RouterLink | 2,929 | 0.91
|
||||||
[ ] |core/ViewChild | 2,870 | 0.89
|
[ ] |core/ViewChild | 2,870 | 0.89
|
||||||
[x] |core/Directive | 2,767 | 0.86
|
[x] |core/Directive | 2,767 | 0.86
|
||||||
[ ] |router/Routes | 2,331 | 0.72
|
[ ] |router/Routes | 2,331 | 0.72
|
||||||
|
@ -22,31 +22,59 @@ import {UrlTree} from '../url_tree';
|
|||||||
*
|
*
|
||||||
* Lets you link to specific routes in your app.
|
* Lets you link to specific routes in your app.
|
||||||
*
|
*
|
||||||
|
* 让你可以在应用中链接到特定的路由。
|
||||||
|
*
|
||||||
* Consider the following route configuration:
|
* Consider the following route configuration:
|
||||||
* `[{ path: 'user/:name', component: UserCmp }]`.
|
* `[{ path: 'user/:name', component: UserCmp }]`.
|
||||||
* When linking to this `user/:name` route, you use the `RouterLink` directive.
|
* 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:
|
* 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">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
|
* If you use dynamic values to generate the link, you can pass an array of path
|
||||||
* segments, followed by the params for each segment.
|
* segments, followed by the params for each segment.
|
||||||
*
|
*
|
||||||
|
* 如果你要用动态值来生成该链接,你可以传入一组路径片段,每个片段后面都可以跟一些参数。
|
||||||
|
*
|
||||||
* For instance `['/team', teamId, 'user', userName, {details: true}]`
|
* For instance `['/team', teamId, 'user', userName, {details: true}]`
|
||||||
* means that we want to generate a link to `/team/11/user/bob;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
|
* Multiple static segments can be merged into one
|
||||||
* (e.g., `['/team/11/user', userName, {details: true}]`).
|
* (e.g., `['/team/11/user', userName, {details: true}]`).
|
||||||
*
|
*
|
||||||
|
* 多个静态片段可以合并为一个(比如 `['/team/11/user', userName, {details: true}]`)。
|
||||||
|
*
|
||||||
* The first segment name can be prepended with `/`, `./`, or `../`:
|
* 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
|
* * If the first segment begins with `/`, the router will look up the route from the root of the
|
||||||
* app.
|
* app.
|
||||||
|
*
|
||||||
|
* 如果第一个片段用 `/` 开头,则路由器会从应用的根路由开始查找。
|
||||||
|
*
|
||||||
* * If the first segment begins with `./`, or doesn't begin with a slash, the router will
|
* * 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.
|
* instead look in the children of the current activated route.
|
||||||
|
*
|
||||||
|
* 如果第一个片段用 `./` 开头或者没有用斜杠开头,路由器就会从当前激活路由开始查找。
|
||||||
|
*
|
||||||
* * And if the first segment begins with `../`, the router will go up one level.
|
* * And if the first segment begins with `../`, the router will go up one level.
|
||||||
*
|
*
|
||||||
|
* 如果第一个片段以 `../` 开头,则路由器将会向上找一级。
|
||||||
|
*
|
||||||
* You can set query params and fragment as follows:
|
* You can set query params and fragment as follows:
|
||||||
*
|
*
|
||||||
|
* 你可以像这样设置查询参数和 `#` 片段:
|
||||||
|
*
|
||||||
* ```
|
* ```
|
||||||
* <a [routerLink]="['/user/bob']" [queryParams]="{debug: true}" fragment="education">
|
* <a [routerLink]="['/user/bob']" [queryParams]="{debug: true}" fragment="education">
|
||||||
* link to user component
|
* 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 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
|
* (Deprecated in v4.0.0 use `queryParamsHandling` instead) You can also tell the
|
||||||
* directive to preserve the current query params and fragment:
|
* directive to preserve the current query params and fragment:
|
||||||
*
|
*
|
||||||
|
* (从 v4.0.0 中开始已废弃,请用 `queryParamsHandling` 来代替)你还可以告诉该指令保留当前的查询参数(`?`)和 `#` 片段:
|
||||||
|
*
|
||||||
* ```
|
* ```
|
||||||
* <a [routerLink]="['/user/bob']" preserveQueryParams preserveFragment>
|
* <a [routerLink]="['/user/bob']" preserveQueryParams preserveFragment>
|
||||||
* link to user component
|
* 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:
|
* You can tell the directive to how to handle queryParams, available options are:
|
||||||
|
*
|
||||||
|
* 你可以告诉该指令要如何处理查询参数,有效的选项包括:
|
||||||
|
*
|
||||||
* - `'merge'`: merge the queryParams into the current queryParams
|
* - `'merge'`: merge the queryParams into the current queryParams
|
||||||
|
*
|
||||||
|
* `'merge'`:把老的查询参数合并进新的查询参数中
|
||||||
|
*
|
||||||
* - `'preserve'`: preserve the current queryParams
|
* - `'preserve'`: preserve the current queryParams
|
||||||
|
*
|
||||||
|
* `'preserve'`:保持当前的查询参数
|
||||||
|
*
|
||||||
* - default/`''`: use the queryParams only
|
* - default/`''`: use the queryParams only
|
||||||
*
|
*
|
||||||
|
* 默认 / `''`:只使用当前查询参数
|
||||||
|
*
|
||||||
* Same options for {@link NavigationExtras#queryParamsHandling
|
* Same options for {@link NavigationExtras#queryParamsHandling
|
||||||
* NavigationExtras#queryParamsHandling}.
|
* NavigationExtras#queryParamsHandling}.
|
||||||
*
|
*
|
||||||
|
* 这个选项和 {@link NavigationExtras#queryParamsHandling
|
||||||
|
* NavigationExtras#queryParamsHandling} 的一样。
|
||||||
|
*
|
||||||
* ```
|
* ```
|
||||||
* <a [routerLink]="['/user/bob']" [queryParams]="{debug: true}" queryParamsHandling="merge">
|
* <a [routerLink]="['/user/bob']" [queryParams]="{debug: true}" queryParamsHandling="merge">
|
||||||
* link to user component
|
* 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.
|
* 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)`.
|
* 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
|
* Then the following link `<a [routerLink]="['/user/jim']">Jim</a>` will generate the link
|
||||||
* `/user/(jim//aux:team)`.
|
* `/user/(jim//aux:team)`.
|
||||||
*
|
*
|
||||||
|
* 那么 `<a [routerLink]="['/user/jim']">Jim</a>` 生成的链接将是 `/user/(jim//aux:team)`。
|
||||||
|
*
|
||||||
* See {@link Router#createUrlTree createUrlTree} for more information.
|
* See {@link Router#createUrlTree createUrlTree} for more information.
|
||||||
*
|
*
|
||||||
|
* 欲知详情,参见 {@link Router#createUrlTree createUrlTree}。
|
||||||
|
*
|
||||||
* @ngModule RouterModule
|
* @ngModule RouterModule
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
@ -163,8 +217,12 @@ export class RouterLink {
|
|||||||
*
|
*
|
||||||
* Lets you link to specific routes in your app.
|
* Lets you link to specific routes in your app.
|
||||||
*
|
*
|
||||||
|
* 允许你在应用中链接到特定的路由。
|
||||||
|
*
|
||||||
* See `RouterLink` for more information.
|
* See `RouterLink` for more information.
|
||||||
*
|
*
|
||||||
|
* 欲知详情,参见 `RouterLink`。
|
||||||
|
*
|
||||||
* @ngModule RouterModule
|
* @ngModule RouterModule
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user