【发布时间】:2018-07-31 04:41:54
【问题描述】:
我是 ionic 2 的新手,我使用 ionic CLI 创建了一个侧边菜单应用程序,并且我有几个页面,但现在我想为每个菜单项添加一个不同的图标,我该怎么做?
这是我的 app.html:
<ion-menu [content]="content">
<ion-header>
<ion-toolbar>
<ion-title>Menu</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<ion-list>
<button menuClose ion-item *ngFor="let p of pages" (click)="openPage(p)">
{{p.title}}
</button>
</ion-list>
</ion-content>
</ion-menu>
<!-- Disable swipe-to-go-back because it's poor UX to combine STGB with side menus -->
<ion-nav [root]="rootPage" #content swipeBackEnabled="false"></ion-nav>
在我的 app.components.ts 中有这些页面:
// used for an example of ngFor and navigation
this.pages = [
{ title: 'Estatísticas', component: "EstatisticasPage"},
{ title: 'Registrar vendas', component: "RegistrarVendasPage" },
{ title: 'Listar vendas', component: "VendasPage" },
{ title: 'Produtos', component: "ProdutosPage" },
{ title: 'Funcionários', component: "FuncionariosPage" },
{ title: 'Clientes', component: "ClientesPage" },
];
【问题讨论】:
标签: ionic-framework