请问loadChildren改怎么使用才对?

adongP
  • 190

我在app-routing.module.ts中写了路由:
{

    path: 'about',
    component: AboutComponent,
    children: [
        {
            path: 'about/componyinstroduction',
            loadChildren: '../pages/about/about.module#ComponyinstroductionComponent'
        },
        {
            path: 'about/teaminstroductionComponent',
            loadChildren: '../pages/about/about.module#TeaminstroductionComponent'
        },
        {
            path: 'about/honourComponent',
            loadChildren: '../pages/about/about.module#HonourComponent'
        },
        {
            path: 'about/structureComponent',
            loadChildren: '../pages/about/about.module#StructureComponent'
        },
        {
            path: 'about/structureComponent',
            loadChildren: '../pages/about/about.module#StructureComponent'
        },
    ]
    
    html加载之后:
    

clipboard.png
点击的时候报错:

clipboard.png

所以还是我的路由写的有问题,请大佬帮瞅瞅,非常感谢

回复
阅读 1k
1 个回答

重启好像就对了谢谢

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
宣传栏