NavigationExtras
表示在导航时用到的额外选项。
Represents the extra options used during navigation.
interface NavigationExtras {
relativeTo?: ActivatedRoute | null
queryParams?: Params | null
fragment?: string
preserveQueryParams?: boolean
queryParamsHandling?: QueryParamsHandling | null
preserveFragment?: boolean
skipLocationChange?: boolean
replaceUrl?: boolean
state?: {...}
}
属性
属性 | 说明 |
---|---|
relativeTo?: ActivatedRoute | null | 允许从当前激活的路由进行相对导航。 Enables relative navigation from the current ActivatedRoute. 配置: Configuration:
从 Navigate to list route from child route:
|
queryParams?: Params | null | 设置 URL 的查询参数。 Sets query parameters to the URL.
|
fragment?: string | 设置 URL 的哈希片段( Sets the hash fragment for the URL.
|
preserveQueryParams?: boolean | 在后续导航时保留查询( Preserves the query parameters for the next navigation. 已废弃,请用 deprecated, use
|
queryParamsHandling?: QueryParamsHandling | null | 配置后续导航时对查询( config strategy to handle the query parameters for the next navigation.
|
preserveFragment?: boolean | 在后续导航时保留 Preserves the fragment for the next navigation
|
skipLocationChange?: boolean | 导航时不要把新状态记入历史 Navigates without pushing a new state into history.
|
replaceUrl?: boolean | 导航时不要把当前状态记入历史 Navigates while replacing the current state in history.
|
state?: {
[k: string]: any;
} | State passed to any navigation. This value will be accessible through the While |