123456789101112131415161718192021 |
- import { NgModule } from '@angular/core';
- import { RouterModule, Routes } from '@angular/router';
- import { ShareComponent } from '../share/share.component';
- import { RecommendDetailComponent } from '../recommend-detail/recommend-detail.component';
- import { AttentionDetailComponent } from '../attention-detail/attention-detail.component';
- import { ScienceDetailComponent } from '../science-detail/science-detail.component';
- import { PageLessonDetailComponent } from '../page-lesson-detail/page-lesson-detail.component';
- const routes: Routes = [
- { path: "share", component: ShareComponent }, // 当路径为 "share" 时,加载 ShareComponent 组件
- { path: "recommend", component: RecommendDetailComponent }, // 当路径为 "recommend" 时,加载 RecommendDetailComponent 组件
- { path: "attention", component: AttentionDetailComponent }, // 当路径为 "attention" 时,加载 AttentionDetailComponent 组件
- { path: "science", component: ScienceDetailComponent }, // 当路径为 "science" 时,加载 ScienceDetailComponent 组件
- { path: "lesson", component: PageLessonDetailComponent },
- ]
- @NgModule({
- imports: [RouterModule.forChild(routes)], // 导入路由配置
- exports: [RouterModule] // 导出路由模块
- })
- export class CommunityRoutingModule { }
|