mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
feat(menu): push type. Fixes #380
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<ion-menu [content]="content" id="leftMenu">
|
||||
<ion-menu [content]="content" id="leftMenu" side="left">
|
||||
|
||||
<ion-toolbar secondary>
|
||||
<ion-title>Left Menu</ion-title>
|
||||
|
||||
27
ionic/components/menu/test/push/index.ts
Normal file
27
ionic/components/menu/test/push/index.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import {App, IonicApp, Page} from 'ionic/ionic';
|
||||
|
||||
|
||||
@Page({templateUrl: 'page1.html'})
|
||||
class Page1 {}
|
||||
|
||||
|
||||
@App({
|
||||
templateUrl: 'main.html'
|
||||
})
|
||||
class E2EApp {
|
||||
|
||||
constructor(app: IonicApp) {
|
||||
this.app = app;
|
||||
this.rootView = Page1;
|
||||
}
|
||||
|
||||
openPage(menu, page) {
|
||||
// close the menu when clicking a link from the menu
|
||||
menu.close();
|
||||
|
||||
// Reset the content nav to have just this page
|
||||
// we wouldn't want the back button to show in this scenario
|
||||
let nav = this.app.getComponent('nav');
|
||||
nav.setRoot(page.component);
|
||||
}
|
||||
}
|
||||
41
ionic/components/menu/test/push/main.html
Normal file
41
ionic/components/menu/test/push/main.html
Normal file
@@ -0,0 +1,41 @@
|
||||
<ion-menu [content]="content" id="leftMenu" type="push" side="left">
|
||||
|
||||
<ion-toolbar secondary>
|
||||
<ion-title>Left Menu</ion-title>
|
||||
</ion-toolbar>
|
||||
|
||||
<ion-content>
|
||||
|
||||
<ion-list>
|
||||
|
||||
<button ion-item menu-toggle="leftMenu" detail-none>
|
||||
Close Left Menu
|
||||
</button>
|
||||
|
||||
</ion-list>
|
||||
</ion-content>
|
||||
|
||||
</ion-menu>
|
||||
|
||||
|
||||
<!-- <ion-menu [content]="content" id="rightMenu" type="reveal" side="right">
|
||||
|
||||
<ion-toolbar secondary>
|
||||
<ion-title>Right Menu</ion-title>
|
||||
</ion-toolbar>
|
||||
|
||||
<ion-content>
|
||||
|
||||
<ion-list>
|
||||
|
||||
<button ion-item menu-toggle="rightMenu">
|
||||
Close Right Menu
|
||||
</button>
|
||||
|
||||
</ion-list>
|
||||
</ion-content>
|
||||
|
||||
</ion-menu> -->
|
||||
|
||||
|
||||
<ion-nav id="nav" [root]="rootView" #content swipe-back-enabled="false"></ion-nav>
|
||||
29
ionic/components/menu/test/push/page1.html
Normal file
29
ionic/components/menu/test/push/page1.html
Normal file
@@ -0,0 +1,29 @@
|
||||
|
||||
<ion-navbar *navbar>
|
||||
|
||||
<a menu-toggle="leftMenu">
|
||||
<icon menu></icon>
|
||||
</a>
|
||||
|
||||
<ion-title>
|
||||
Push Menu
|
||||
</ion-title>
|
||||
|
||||
</ion-navbar>
|
||||
|
||||
|
||||
<ion-content #content padding>
|
||||
|
||||
<h3>Content</h3>
|
||||
|
||||
<p>
|
||||
<button menu-toggle="leftMenu">Toggle Left Menu</button>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<button menu-toggle="rightMenu">Toggle Right Menu</button>
|
||||
</p>
|
||||
|
||||
<f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f>
|
||||
|
||||
</ion-content>
|
||||
Reference in New Issue
Block a user