自从我实现了标签栏以来,我不再能够在不使用标签栏的情况下进行导航。我想在标签栏之外进行一些导航。
标签栏
<ion-tabs>
<ion-tab-bar slot="bottom">
<ion-tab-button tab="map">
<ion-icon name="map-outline"></ion-icon>
<ion-label>Map</ion-label>
</ion-tab-button>
<ion-tab-button tab="restaurant-list">
<ion-icon name="storefront-outline"></ion-icon>
<ion-label>Restaurants</ion-label>
</ion-tab-button>
</ion-tab-bar>
</ion-tabs>
选项卡路由
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { TabsPage } from './tabs.page';
const routes: Routes = [
{
path: 'tabs',
component: TabsPage,
children: [
{
path: 'map',
loadChildren: () => import('../map/map.module').then(m => m.MapPageModule)
},
{
path: 'item-details',
loadChildren: () => import('../item-details/item-details.module').then(m => m.ItemDetailsPageModule)
},
{
path: 'restaurant-list',
loadChildren: () => import('../restaurant-list/restaurant-list.module').then(m => m.RestaurantListPageModule)
},
{
path: 'restaurant-details',
loadChildren: () => import('../restaurant-details/restaurant-details.module').then(m => m.RestaurantDetailsPageModule)
},
{
path: 'item-details',
loadChildren: () => import('../item-details/item-details.module').then(m => m.ItemDetailsPageModule)
},
]
},
{
path: '',
redirectTo: 'tabs/map',
pathMatch: 'full'
}
];
我不能再使用导航了
<a routerLink='/restaurant-list'>Continue to view restaurants</a>
我也试过了,但还是失败了
<a routerLink='/tabs/restaurant-list'>Continue to view restaurants</a>