项目初始化
This commit is contained in:
36
src/app/routes/routes-routing.module.ts
Normal file
36
src/app/routes/routes-routing.module.ts
Normal file
@ -0,0 +1,36 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
// layout
|
||||
import { LayoutProComponent } from '@brand';
|
||||
import { environment } from '@env/environment';
|
||||
// dashboard pages
|
||||
import { DashboardComponent } from './dashboard/dashboard.component';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: LayoutProComponent,
|
||||
children: [
|
||||
{ path: '', redirectTo: 'dashboard', pathMatch: 'full' },
|
||||
{ path: 'dashboard', component: DashboardComponent },
|
||||
],
|
||||
},
|
||||
// passport
|
||||
{ path: '', loadChildren: () => import('./passport/passport.module').then((m) => m.PassportModule) },
|
||||
{ path: 'exception', loadChildren: () => import('./exception/exception.module').then((m) => m.ExceptionModule) },
|
||||
// 单页不包裹Layout
|
||||
{ path: '**', redirectTo: 'exception/404' },
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
RouterModule.forRoot(routes, {
|
||||
useHash: environment.useHash,
|
||||
// NOTICE: If you use `reuse-tab` component and turn on keepingScroll you can set to `disabled`
|
||||
// Pls refer to https://ng-alain.com/components/reuse-tab
|
||||
scrollPositionRestoration: 'top',
|
||||
}),
|
||||
],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class RouteRoutingModule {}
|
||||
Reference in New Issue
Block a user