【发布时间】:2019-06-28 20:56:24
【问题描述】:
我有一个 ionic 应用程序项目,底部有标签,我正在尝试创建一个新标签以链接到我创建的新页面,当我执行正确的代码时,它不会在按下后转到该页面新制作的标签按钮我联系了离子支持,他们说它看起来不错,但他们无法进一步帮助我
这是我的离子标签代码
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { TabsPage } from './tabs.page';
import { FormsPage } from 'forms.page'
const routes: Routes = [
{
path: 'tabs',
component: TabsPage,
children: [
{
path: 'tab1',
children: [
{
path: '',
loadChildren: '../tab1/tab1.module#Tab1PageModule'
}
]
},
{
path: 'parties',
children: [
{
path: '',
loadChildren: '../tab2/tab2.module#Tab2PageModule'
}
]
},
{
path: 'tab3',
children: [
{
path: '',
loadChildren: '../tab3/tab3.module#Tab3PageModule'
}
]
},
{
path: '',
redirectTo: '/tabs/tab1',
pathMatch: 'full'
}
]
},
{
path: 'forms',
children: [
{
path: '',
loadChildren: '../forms/forms.module#FormsPageModule'
}
]
},
{
path: '',
redirectTo: '/tabs/tab1',
pathMatch: 'full'
}
];
@NgModule({
imports: [
RouterModule.forChild(routes)
],
exports: [RouterModule]
})
export class TabsPageRoutingModule {}
<ion-tabs>
<ion-tab-bar slot="bottom">
<ion-tab-button tab="tab1">
<ion-icon name="flash"></ion-icon>
<ion-label>Tab One</ion-label>
</ion-tab-button>
<ion-tab-button tab="parties">
<ion-icon name="apps"></ion-icon>
<ion-label>Tab Two</ion-label>
</ion-tab-button>
<ion-tab-button tab="tab3">
<ion-icon name="send"></ion-icon>
<ion-label>Tab Three</ion-label>
</ion-tab-button>
<ion-tab-button tab="forms">
<ion-icon name="clipboard"></ion-icon>
<ion-label>Forms</ion-label>
</ion-tab-button>
</ion-tab-bar>
</ion-tabs>
【问题讨论】:
标签: javascript html ios ionic-framework