import { Routes,RouterModule } from '@angular/router'; import { PostPageComponent } from './post-page/post-page.component'; // 导入 PostPage 组件 import { CommunityPage } from './community/community.page'; import { SharePageComponent } from './share-page/share-page.component'; import { NgModule } from '@angular/core'; export const routes: Routes = [ { path: '', loadChildren: () => import('./tabs/tabs.routes').then((m) => m.routes), }, { path: 'community', loadComponent: () => import('./community/community.page').then( m => m.CommunityPage) }, { path: '', redirectTo: 'community', pathMatch: 'full' }, { path: 'community', component: CommunityPage }, { path: 'post-page/:id', component: PostPageComponent }, // 动态详情页面的路由 { path: 'share', component: SharePageComponent }, ]; @NgModule({ imports: [RouterModule.forRoot(routes)], exports: [RouterModule] }) export class AppRoutingModule { }