import { BrowserModule } from '@angular/platform-browser';
import { AppRoutingModule } from './app-routing.module';
import { RouterModule, Routes } from '@angular/router'; // 导入 RouterModule 和 Routes
import { FormsModule } from '@angular/forms';
import { CommonModule } from '@angular/common';
import { IonicModule } from '@ionic/angular';

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';
import { NavTabsComponent } from 'src/modules/craftsmart/nav-tabs/nav-tabs.component';
import { NgModule ,CUSTOM_ELEMENTS_SCHEMA} from '@angular/core';
import { PageDiscoverComponent } from 'src/modules/craftsmart/page-discover/page-discover.component';
import { PageLoginComponent } from 'src/modules/craftsmart/page-login/page-login.component';
// import { PageLoginComponent } from 'src/modules/user/page-login/page-login.component';



const routes: Routes = [
  { path: 'home', component: HomeComponent },
  { path: 'cart', component: PageCartComponent },
  {path:'discover',component:PageDiscoverComponent},
  { path: 'mine', component: PageMineComponent },
  { path: 'login', component: PageLoginComponent },


  // { path: 'login', component: PageLoginComponent },


];

@NgModule({
  declarations: [
    AppComponent,
    NavTabsComponent
  ],
  imports: [
    BrowserModule,
    AppRoutingModule,
    FormsModule,
    CommonModule,
    RouterModule.forRoot(routes),
    IonicModule.forRoot() // 在这里配置根路由
  ],
  providers: [],
  bootstrap: [AppComponent],
  schemas: [CUSTOM_ELEMENTS_SCHEMA] // 添加 CUSTOM_ELEMENTS_SCHEMA

})
export class AppModule { }
