【发布时间】:2022-05-12 01:22:45
【问题描述】:
我正在使用 Ionic App,我想在侧边栏中显示子菜单。我正在使用*ngFor 获取菜单,但问题是我无法显示子菜单。
这是我的app.html:
<ion-menu [content]="content" side="left" type="overlay">
<ion-content class="mymenu22">
<ion-grid class="formenu11">
<h1 class="mymenuh11">OTHERS</h1>
</ion-grid>
<ion-list>
<button menuClose ion-item *ngFor="let p1 of pages1" (click)="openPage(p1)" class="menu2">
<ion-icon name="{{p1.name1}}"></ion-icon> {{p1.title1}}
</button>
</ion-list>
</ion-content>
</ion-menu>
在这里,我在侧边栏中显示菜单,我想显示第一个菜单的子菜单。
这是我的 app.component.ts:
pages1: Array<{title1: string, component: any, name1: string}>;
this.pages1 = [
{ title1: 'Manage Account', component: ManageaccountPage, name1: 'settings' },
{ title1: 'About Us', component: AboutPage, name1: 'people' },
{ title1: 'Gallery', component: GalleryPage, name1: 'images' },
{ title1: 'Contact Us', component: ContactPage, name1: 'contacts' },
];
对于管理帐户,我想显示子菜单。
对于管理帐户,我想显示子菜单,但我没有得到任何代码。
非常感谢任何帮助。
【问题讨论】: