import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';

const routes: Routes = [
  {
    path: "", redirectTo: "/home-page/home", pathMatch: "full"
  },
  {
    path: 'home-page',
    loadChildren: () => import('../modules/home-page/home-page.module').then(m => m.HomePageModule)
  }, {
    path: 'community',
    loadChildren: () => import('../modules/community/community.module').then(m => m.CommunityModule)
  }, {
    path: 'shop',
    loadChildren: () => import('../modules/shop/shop.module').then(m => m.ShopModule)
  }, {
    path: 'mine',
    loadChildren: () => import('../modules/mine/mine.module').then(m => m.MineModule)
  }, {
    path: 'create',
    loadChildren: () => import('../modules/create/create.module').then(m => m.CreateModule)
  }, {
    path: 'user',
    loadChildren: () => import('../modules/user/user.module').then(m => m.UserModule)
  }
];
// let lessonRoute = {
//   path: 'lesson',
//   loadChildren: () => import('../modules/lesson/lesson.module').then(m => m.LessonModule)
// }    //引入主模块路由lesson.module

// routes.push(lessonRoute)//push操作将路由以json格式导入路由列表
@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule]
})
export class AppRoutingModule { }
