首页 > 解决方案 > loadChildren 是什么意思以及在 Ionic 4 中使用什么?

问题描述

我有以下问题:

  1. 我搬到了 Ionic 4,我可以看到它不是{ path: '', component: WalkthroughComponent }写的{ path: '', loadChildren: '/Walktrhough#WalkthroughModule'}。我可以知道细节上的区别吗?我的应用程序没有那么大,根本不会有 25-30 条路线,我根本不想使用 loadChildren。你怎么看?

  2. Ionic 4 有 pages 的东西,这意味着你可以创建页面。我学习了 Angular,所以我只是在创建组件。所以主页也是一个组件。一切都是一个组成部分。这是错的吗?我可以在 Ionic 4 中遵循这个结构吗?

  3. 我对两者之间的区别感兴趣

     this.navCtrl.navigateRoot("/error");
    

     this.router.navigateRoot("/error");.
    

    什么时候用哪个?

标签: angularionic-frameworkionic2ionic3ionic4

解决方案


推荐阅读