RouterLinkWithHref

Lets you link to specific routes in your app.

允许你在应用中链接到特定的路由。

@Directive({ selector: 'a[routerLink]' }) class RouterLinkWithHref implements OnChanges, OnDestroy { target: string queryParams: {...} fragment: string queryParamsHandling: QueryParamsHandling preserveFragment: boolean skipLocationChange: boolean replaceUrl: boolean href: string set routerLink: any[] | string set preserveQueryParams: boolean get urlTree: UrlTree ngOnChanges(changes: {...}): any ngOnDestroy(): any onClick(button: number, ctrlKey: boolean, metaKey: boolean, shiftKey: boolean): boolean }

选择器

a[routerLink]

输入参数

queryParams 绑定到 RouterLinkWithHref.queryParams
fragment 绑定到 RouterLinkWithHref.fragment
queryParamsHandling 绑定到 RouterLinkWithHref.queryParamsHandling
preserveFragment 绑定到 RouterLinkWithHref.preserveFragment
skipLocationChange 绑定到 RouterLinkWithHref.skipLocationChange
replaceUrl 绑定到 RouterLinkWithHref.replaceUrl

说明

See RouterLink for more information.

欲知详情,参见 RouterLink

属性

属性名类型说明
target
queryParams
fragment
queryParamsHandling
preserveFragment
skipLocationChange
replaceUrl
href
routerLink
preserveQueryParams
urlTree只读

方法

ngOnChanges(changes: { }): any

参数

changes

Type: { }.

返回值

any

ngOnDestroy(): any

参数

没有参数。

返回值

any

onClick(button: number, ctrlKey: boolean, metaKey: boolean, shiftKey: boolean): boolean

参数

button

Type: number.

ctrlKey

Type: boolean.

metaKey

Type: boolean.

shiftKey

Type: boolean.

返回值

boolean