目录
一、概述
tabs-routing.module是Ionic4的一个子路由配置文件。
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { TabsPage } from './tabs.page';
const routes: Routes = [
{
path: 'tabs',
component: TabsPage,
children: [
{
path: 'tab1',
children: [
{
path: '',
loadChildren:()=>import('../tab1/tab1.module').then(m=>m.Tab1PageModule)
}
]
},
{
path: '',
redirectTo: '/tabs/tab1',
pathMatch: 'full'
}
]
},
{
path: '',
redirectTo: '/tabs/tab1',
pathMatch: 'full'
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class TabsPageRoutingModule {}
二、依赖详解
//Angular核心
import { NgModule } from '@angular/core';
//路由
import { RouterModule, Routes } from '@a