mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 12:29:55 +08:00
chore(demos): update menu demos
This commit is contained in:
@ -1,20 +1,20 @@
|
||||
import {App, IonicApp, Page} from 'ionic/ionic';
|
||||
import {App, Page, MenuController} from 'ionic/ionic';
|
||||
|
||||
@Page({templateUrl: 'page1.html'})
|
||||
class Page1 {
|
||||
constructor(app: IonicApp) {
|
||||
this.app = app;
|
||||
constructor(menu: MenuController) {
|
||||
this.menu = menu;
|
||||
this.menu1Active();
|
||||
}
|
||||
menu1Active() {
|
||||
this.activeMenu = 'menu1';
|
||||
this.app.getComponent('menu1').enable(true);
|
||||
this.app.getComponent('menu2').enable(false);
|
||||
this.menu.enable(true, 'menu1');
|
||||
this.menu.enable(false, 'menu2');
|
||||
}
|
||||
menu2Active() {
|
||||
this.activeMenu = 'menu2';
|
||||
this.app.getComponent('menu1').enable(false);
|
||||
this.app.getComponent('menu2').enable(true);
|
||||
this.menu.enable(false, 'menu1');
|
||||
this.menu.enable(true, 'menu2');
|
||||
}
|
||||
}
|
||||
|
||||
@ -22,8 +22,7 @@ class Page1 {
|
||||
templateUrl: 'main.html'
|
||||
})
|
||||
class ApiDemoApp {
|
||||
constructor(app: IonicApp) {
|
||||
this.app = app;
|
||||
constructor() {
|
||||
this.rootView = Page1;
|
||||
}
|
||||
}
|
||||
|
@ -1,20 +1,20 @@
|
||||
import {App, IonicApp, Page} from 'ionic/ionic';
|
||||
import {App, Page, MenuController} from 'ionic/ionic';
|
||||
|
||||
@Page({templateUrl: 'page1.html'})
|
||||
class Page1 {
|
||||
constructor(app: IonicApp) {
|
||||
this.app = app;
|
||||
constructor(menu: MenuController) {
|
||||
this.menu = menu;
|
||||
this.menu1Active();
|
||||
}
|
||||
menu1Active() {
|
||||
this.activeMenu = 'menu1';
|
||||
this.app.getComponent('menu1').enable(true);
|
||||
this.app.getComponent('menu2').enable(false);
|
||||
this.menu.enable(true, 'menu1');
|
||||
this.menu.enable(false, 'menu2');
|
||||
}
|
||||
menu2Active() {
|
||||
this.activeMenu = 'menu2';
|
||||
this.app.getComponent('menu1').enable(false);
|
||||
this.app.getComponent('menu2').enable(true);
|
||||
this.menu.enable(false, 'menu1');
|
||||
this.menu.enable(true, 'menu2');
|
||||
}
|
||||
}
|
||||
|
||||
@ -22,8 +22,7 @@ class Page1 {
|
||||
templateUrl: 'main.html'
|
||||
})
|
||||
class ApiDemoApp {
|
||||
constructor(app: IonicApp) {
|
||||
this.app = app;
|
||||
constructor() {
|
||||
this.rootView = Page1;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user