1
我正嘗試在離子2應用程序的側面導航面板上設置圖標,請建議我如何完成此操作? 這裏是我的代碼:如何在離子2應用程序的側面導航面板菜單中設置圖標
export class MyApp {
@ViewChild(Nav) nav: Nav;
rootPage: any = MysplashPage;
private dashboardpage;
private gradesubjectpage;
private myhomepage;
pages: Array<{title: string, component: any}>;
constructor(public platform: Platform, public statusBar: StatusBar, public splashScreen: SplashScreen) {
this.initializeApp();
\t this.pages = [
{ title: 'Explore', component: HomePage },
{ title: 'Dashboard', component: DashboardPage }
\t ];
}
initializeApp() {
this.platform.ready().then(() => {
this.statusBar.styleDefault();
// this.splashScreen.hide();
});
}
openPage(pages) {
if(pages.component == HomePage){
this.nav.setRoot(HomePage);
} else {
this.nav.push(pages.component);
}
\t
}
}
<ion-list>
<button menuClose ion-item *ngFor="let p of pages" (click)="openPage(p)">
<b>{{p.title}}</b>
</button>
</ion-list>