mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-24 14:58:36 +08:00
feat(menu): enable/disable side menus
This commit is contained in:
33
ionic/components/menu/test/multiple/index.ts
Normal file
33
ionic/components/menu/test/multiple/index.ts
Normal file
@ -0,0 +1,33 @@
|
||||
import {App, IonicApp, Page, NavController} from 'ionic/ionic';
|
||||
|
||||
|
||||
@Page({
|
||||
templateUrl: 'page1.html'
|
||||
})
|
||||
class Page1 {
|
||||
constructor(app: IonicApp) {
|
||||
this.app = app;
|
||||
this.menu1Active();
|
||||
}
|
||||
menu1Active() {
|
||||
this.activeMenu = 'menu1';
|
||||
this.app.getComponent('menu1').enabled(true);
|
||||
this.app.getComponent('menu2').enabled(false);
|
||||
}
|
||||
menu2Active() {
|
||||
this.activeMenu = 'menu2';
|
||||
this.app.getComponent('menu1').enabled(false);
|
||||
this.app.getComponent('menu2').enabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@App({
|
||||
templateUrl: 'main.html'
|
||||
})
|
||||
class E2EApp {
|
||||
constructor(app: IonicApp) {
|
||||
this.app = app;
|
||||
this.rootPage = Page1;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user