123456789101112131415161718192021222324252627282930 |
- import { NgModule } from '@angular/core';
- import { BrowserModule } from '@angular/platform-browser';
- import { AppRoutingModule } from './app-routing.module';
- import { RouterModule, Routes } from '@angular/router'; // 导入 RouterModule 和 Routes
- import { AppComponent } from './app.component';
- import { HomeComponent } from 'src/modules/craftsmart/home/home.component';
- import { PageCartComponent } from 'src/modules/craftsmart/page-cart/page-cart.component';
- import { PageMineComponent } from 'src/modules/craftsmart/page-mine/page-mine.component';
- const routes: Routes = [
- { path: 'home', component: HomeComponent },
- { path: 'cart', component: PageCartComponent },
- { path: 'mine', component: PageMineComponent },
- ];
- @NgModule({
- declarations: [
- AppComponent
- ],
- imports: [
- BrowserModule,
- AppRoutingModule,
- RouterModule.forRoot(routes) // 在这里配置根路由
- ],
- providers: [],
- bootstrap: [AppComponent]
- })
- export class AppModule { }
|