InitialNavigation
ExtraOptions
对象中的允许值,用于配置路由器何时执行初始导航操作。
Allowed values in an ExtraOptions
object that configure when the router performs the initial navigation operation.
type InitialNavigation = 'disabled' | 'enabled' | 'enabledBlocking' | 'enabledNonBlocking';
参见
forRoot()
说明
'enabledNonBlocking' -(默认值)在创建根组件之后开始初始导航。初始导航完成后,引导程序不会被阻止。
'enabledNonBlocking' - (default) The initial navigation starts after the root component has been created. The bootstrap is not blocked on the completion of the initial navigation.
'enabledBlocking' - 初始导航在创建根组件之前开始。引导程序将被阻止,直到完成初始导航为止。该值是让服务器渲染正常工作所必需的。
'enabledBlocking' - The initial navigation starts before the root component is created. The bootstrap is blocked until the initial navigation is complete. This value is required for server-side rendering to work.
false
- 同 'legacy_disabled'. @deprecated since v4'disabled' - The initial navigation is not performed. The location listener is set up before the root component gets created. Use if there is a reason to have more control over when the router starts its initial navigation due to some complex initialization logic.
从 v11 开始不推荐使用以下值,并且不应将其用于新应用程序。
The following values have been deprecated since v11, and should not be used for new applications.
'enabled' - 此选项可以 1:1 替换为
enabledNonBlocking
。'enabled' - This option is 1:1 replaceable with
enabledBlocking
.