mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-21 21:15:24 +08:00
51 lines
898 B
TypeScript
51 lines
898 B
TypeScript
import {App, Page, ActionSheet, NavController} from 'ionic/ionic';
|
|
|
|
|
|
@App({
|
|
templateUrl: 'app.html'
|
|
})
|
|
class ApiDemoApp {
|
|
constructor() {
|
|
this.rootPage = InitialPage;
|
|
}
|
|
}
|
|
|
|
|
|
@Page({
|
|
templateUrl: 'main.html'
|
|
})
|
|
export class InitialPage {
|
|
constructor(nav: NavController) {
|
|
this.nav = nav;
|
|
}
|
|
|
|
present() {
|
|
let actionSheet = ActionSheet.create({
|
|
buttons: [
|
|
{
|
|
text: 'Destructive',
|
|
style: 'destructive',
|
|
handler: () => {
|
|
console.log('Destructive clicked');
|
|
}
|
|
},
|
|
{
|
|
text: 'Archive',
|
|
handler: () => {
|
|
console.log('Archive clicked');
|
|
}
|
|
},
|
|
{
|
|
text: 'Cancel',
|
|
style: 'cancel',
|
|
handler: () => {
|
|
console.log('Cancel clicked');
|
|
}
|
|
}
|
|
]
|
|
});
|
|
|
|
this.nav.present(actionSheet);
|
|
}
|
|
}
|