docs(API): 翻译完了 RouterLinkActive

This commit is contained in:
Zhicheng Wang 2018-09-04 10:25:36 +08:00
parent e8d4f26644
commit 46a2608476
2 changed files with 22 additions and 2 deletions

View File

@ -48,7 +48,7 @@
[x] | platform-browser/BrowserModule | 0.40 [x] | platform-browser/BrowserModule | 0.40
[x] | common/DecimalPipe | 0.40 [x] | common/DecimalPipe | 0.40
[x] | common/CurrencyPipe | 0.39 [x] | common/CurrencyPipe | 0.39
[ ] | router/RouterLinkActive | 0.38 [x] | router/RouterLinkActive | 0.38
[ ] | core/TemplateRef | 0.38 [ ] | core/TemplateRef | 0.38
[ ] | forms/FormBuilder | 0.37 [ ] | forms/FormBuilder | 0.37
[ ] | common/http/HttpParams | 0.35 [ ] | common/http/HttpParams | 0.35

View File

@ -21,11 +21,17 @@ import {RouterLink, RouterLinkWithHref} from './router_link';
* *
* Lets you add a CSS class to an element when the link's route becomes active. * Lets you add a CSS class to an element when the link's route becomes active.
* *
* 宿 CSS
*
* This directive lets you add a CSS class to an element when the link's route * This directive lets you add a CSS class to an element when the link's route
* becomes active. * becomes active.
* *
* 宿 CSS
*
* Consider the following example: * Consider the following example:
* *
*
*
* ``` * ```
* <a routerLink="/user/bob" routerLinkActive="active-link">Bob</a> * <a routerLink="/user/bob" routerLinkActive="active-link">Bob</a>
* ``` * ```
@ -33,8 +39,13 @@ import {RouterLink, RouterLinkWithHref} from './router_link';
* When the url is either '/user' or '/user/bob', the active-link class will * When the url is either '/user' or '/user/bob', the active-link class will
* be added to the `a` tag. If the url changes, the class will be removed. * be added to the `a` tag. If the url changes, the class will be removed.
* *
* url '/user' '/user/bob' `a` `active-link`
* url
*
* You can set more than one class, as follows: * You can set more than one class, as follows:
* *
*
*
* ``` * ```
* <a routerLink="/user/bob" routerLinkActive="class1 class2">Bob</a> * <a routerLink="/user/bob" routerLinkActive="class1 class2">Bob</a>
* <a routerLink="/user/bob" [routerLinkActive]="['class1', 'class2']">Bob</a> * <a routerLink="/user/bob" [routerLinkActive]="['class1', 'class2']">Bob</a>
@ -43,6 +54,8 @@ import {RouterLink, RouterLinkWithHref} from './router_link';
* You can configure RouterLinkActive by passing `exact: true`. This will add the classes * You can configure RouterLinkActive by passing `exact: true`. This will add the classes
* only when the url matches the link exactly. * only when the url matches the link exactly.
* *
* `exact: true` RouterLinkActive url
*
* ``` * ```
* <a routerLink="/user/bob" routerLinkActive="active-link" [routerLinkActiveOptions]="{exact: * <a routerLink="/user/bob" routerLinkActive="active-link" [routerLinkActiveOptions]="{exact:
* true}">Bob</a> * true}">Bob</a>
@ -50,6 +63,9 @@ import {RouterLink, RouterLinkWithHref} from './router_link';
* *
* You can assign the RouterLinkActive instance to a template variable and directly check * You can assign the RouterLinkActive instance to a template variable and directly check
* the `isActive` status. * the `isActive` status.
*
* `RouterLinkActive` `isActive`
*
* ``` * ```
* <a routerLink="/user/bob" routerLinkActive #rla="routerLinkActive"> * <a routerLink="/user/bob" routerLinkActive #rla="routerLinkActive">
* Bob {{ rla.isActive ? '(already open)' : ''}} * Bob {{ rla.isActive ? '(already open)' : ''}}
@ -58,8 +74,10 @@ import {RouterLink, RouterLinkWithHref} from './router_link';
* *
* Finally, you can apply the RouterLinkActive directive to an ancestor of a RouterLink. * Finally, you can apply the RouterLinkActive directive to an ancestor of a RouterLink.
* *
* `RouterLinkActive` `RouterLink`
*
* ``` * ```
* <div routerLinkActive="active-link" [routerLinkActiveOptions]="{exact: true}"> * <div routerLinkActive="active-link">
* <a routerLink="/user/jim">Jim</a> * <a routerLink="/user/jim">Jim</a>
* <a routerLink="/user/bob">Bob</a> * <a routerLink="/user/bob">Bob</a>
* </div> * </div>
@ -68,6 +86,8 @@ import {RouterLink, RouterLinkWithHref} from './router_link';
* This will set the active-link class on the div tag if the url is either '/user/jim' or * This will set the active-link class on the div tag if the url is either '/user/jim' or
* '/user/bob'. * '/user/bob'.
* *
* url '/user/jim' '/user/bob' `div` `active-link`
*
* @ngModule RouterModule * @ngModule RouterModule
* *
* *