Ionic2:Two 两个根文件上的不同菜单

Ionic2:Two different menus on two root file

我在 ionic 2 项目中创建了两个根文件。一个是 app.component,另一个是报告菜单。我在 app.component.module.ts 文件中导入了报告菜单模块。我的一个菜单在 app.html 中,另一个在 report-menu.html 中。但它不起作用。有可能实现吗?

是的,有可能实现这一目标。但是两个菜单都需要定义在app.component.html.

加载report-menu模块后,您需要使用MenuController api禁用默认菜单并启用与report-menu相关的菜单。

所以答案是,您可以在 app.component.html 中定义多个菜单并在页面上启用它们。