NavigationStart
代表导航开始时触发的事件。
Represents an event triggered when a navigation starts.
class NavigationStart extends RouterEvent {
constructor(id: number, url: string, navigationTrigger: "imperative" | "popstate" | "hashchange" = 'imperative', restoredState: { [k: string]: any; navigationId: number; } = null)
navigationTrigger?: 'imperative' | 'popstate' | 'hashchange'
restoredState?: {...}
toString(): string
// 继承自 router/RouterEvent
constructor(id: number, url: string)
id: number
url: string
}
构造函数
参数
|
属性
属性 | 说明 |
---|---|
navigationTrigger?: 'imperative' | 'popstate' | 'hashchange' | 表示导航过程中的触发器。 Identifies the trigger of the navigation.
|
restoredState?: {
[k: string]: any;
navigationId: number;
} | null | 这里包含的 This reflects the state object that was previously supplied to the pushState call. This is not null only when the navigation is triggered by a popstate event. 路由器会把一个 The router assigns a navigationId to every router transition/navigation. Even when the user clicks on the back button in the browser, a new navigation id will be created. So from the perspective of the router, the router never "goes back". By using the 欲知详情,参见 See |
方法
参数没有参数。 返回值
|