Event
路由器事件能让你跟踪路由器的生命周期。
Router events that allow you to track the lifecycle of the router.
type Event = RouterEvent | RouteConfigLoadStart | RouteConfigLoadEnd | ChildActivationStart | ChildActivationEnd | ActivationStart | ActivationEnd | Scroll;
说明
这些事件按以下顺序发生:
The events occur in the following sequence:
NavigationStart:导航开始。
NavigationStart: Navigation starts.
RouteConfigLoadStart :在路由器惰性加载路由配置之前。
RouteConfigLoadStart: Before the router lazy loads a route configuration.
RouteConfigLoadEnd :惰性加载路由后。
RouteConfigLoadEnd: After a route has been lazy loaded.
RoutesRecognized :路由器解析 URL 并识别出路由时。
RoutesRecognized: When the router parses the URL and the routes are recognized.
GuardsCheckStart :当路由器开始路由的守卫阶段时。
GuardsCheckStart: When the router begins the guards phase of routing.
ChildActivationStart :当路由器开始激活子路由时。
ChildActivationStart: When the router begins activating a route's children.
ActivationStart :路由器开始激活路由时。
ActivationStart: When the router begins activating a route.
GuardsCheckEnd :当路由器成功完成路由的保护阶段时。
GuardsCheckEnd: When the router finishes the guards phase of routing successfully.
ResolveStart :路由器开始路由的解析阶段时。
ResolveStart: When the router begins the resolve phase of routing.
ResolveEnd :当路由器成功完成路由的解析阶段时。
ResolveEnd: When the router finishes the resolve phase of routing successfuly.
ChildActivationEnd :当路由器完成激活子路由时。
ChildActivationEnd: When the router finishes activating a route's children.
ActivationEnd :路由器完成路由激活后。
ActivationEnd: When the router finishes activating a route.
NavigationEnd :导航成功结束时。
NavigationEnd: When navigation ends successfully.
NavigationCancel :取消导航时。
NavigationCancel: When navigation is canceled.
NavigationError :由于意外错误导致导航失败时。
NavigationError: When navigation fails due to an unexpected error.
Scroll:用户滚动时。
Scroll: When the user scrolls.